(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/plugins/lazy-expunge/lazy-expunge-plugin.c) |
| |
| 379 | | | mailbox_move(struct mailbox_list *src_list, const char *src_name, |
| 380 | | | struct mailbox_list *dest_list, const char **_dest_name) |
| 381 | | | { |
| 382 | | | const char *dest_name = *_dest_name; |
| 383 | | | const char *srcdir, *src2dir, *src3dir, *destdir, *p, *destparent; |
| 384 | | | const char *origin; |
| 385 | | | struct stat st; |
| 386 | | | mode_t mode; |
| 387 | | | gid_t gid; |
| 388 | | | |
| 389 | | | srcdir = mailbox_list_get_path(src_list, src_name, |
| 390 | | | MAILBOX_LIST_PATH_TYPE_MAILBOX); |
| 391 | | | destdir = mailbox_list_get_path(dest_list, dest_name, |
| 392 | | | MAILBOX_LIST_PATH_TYPE_MAILBOX); |
| 393 | | | while (rename(srcdir, destdir) < 0) { |
Event 1:
Entering loop body. rename(srcdir, destdir) < 0 evaluates to true.
hide
|
|
| 394 | | | if (errno == ENOENT) {
x /usr/include/asm-generic/errno-base.h |
| |
5 | #define ENOENT 2 /* No such file or directory */ |
| |
|
Event 2:
Taking true branch. errno == 2 evaluates to true.
hide
|
|
| 395 | | | |
| 396 | | | |
| 397 | | | p = strrchr(destdir, '/'); |
| 398 | | | if (p == NULL) |
Event 3:
Skipping " if". p == (void *)0 evaluates to false.
hide
|
|
| 399 | | | return 0; |
| 400 | [+] | | destparent = t_strdup_until(destdir, p); |
 |
| 401 | | | if (stat(destparent, &st) == 0) |
Event 14:
destparent, which evaluates to the value assigned to mem at strfuncs.c:65, is passed to stat64() as the first argument. See related event 13.
hide
Event 15:
stat64() accesses the file named destparent, where destparent is the value assigned to mem at strfuncs.c:65. - The same name is used to access a file later, but it is not safe to assume that it will be the same underlying file.
See related event 14.
hide
Event 16:
Skipping " if". stat(destparent, &st) == 0 evaluates to false.
hide
|
|
| 402 | | | return 0; |
| 403 | | | |
| 404 | | | mailbox_list_get_dir_permissions(dest_list, NULL, |
| 405 | | | &mode, &gid, &origin); |
| 406 | | | if (mkdir_parents_chgrp(destparent, mode, |
Event 17:
destparent, which evaluates to the value assigned to mem at strfuncs.c:65, is passed to mkdir_parents_chgrp() as the first argument. See related events 13 and 14.
hide
|
|
| 407 | [+] | | gid, origin) < 0) { |
 |
| |