(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/index/cydir/cydir-storage.c) |
| |
| 183 | | | static struct mailbox * |
| 184 | | | cydir_mailbox_open(struct mail_storage *_storage, const char *name, |
| 185 | | | struct istream *input, enum mailbox_open_flags flags) |
| 186 | | | { |
| 187 | | | struct cydir_storage *storage = (struct cydir_storage *)_storage; |
| 188 | | | const char *path; |
| 189 | | | struct stat st; |
| 190 | | | |
| 191 | | | if (input != NULL) { |
Event 1:
Skipping " if". input != (void *)0 evaluates to false.
hide
|
|
| 192 | | | mail_storage_set_critical(_storage, |
| 193 | | | "cydir doesn't support streamed mailboxes"); |
| 194 | | | return NULL; |
| 195 | | | } |
| 196 | | | |
| 197 | | | path = mailbox_list_get_path(_storage->list, name, |
Event 3:
path is set to mailbox_list_get_path(...), which evaluates to list->v.get_path(...) from mailbox-list.c:446. See related event 2.
hide
|
|
| 198 | [+] | | MAILBOX_LIST_PATH_TYPE_MAILBOX); |
 |
| 199 | | | if (stat(path, &st) == 0) |
Event 4:
path, which evaluates to list->v.get_path(...) from mailbox-list.c:446, is passed to stat64() as the first argument. See related event 3.
hide
Event 5:
stat64() accesses the file named path, where path is list->v.get_path(...) from mailbox-list.c:446. - 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 4.
hide
Event 6:
Taking false branch. stat(path, &st) == 0 evaluates to false.
hide
|
|
| 200 | | | return cydir_open(storage, name, flags); |
| 201 | | | else if (errno == ENOENT) {
x /usr/include/asm-generic/errno-base.h |
| |
5 | #define ENOENT 2 /* No such file or directory */ |
| |
|
Event 7:
Taking true branch. errno == 2 evaluates to true.
hide
|
|
| 202 | | | if (strcmp(name, "INBOX") == 0) { |
Event 8:
Taking true branch. strcmp(name, "INBOX") == 0 evaluates to true.
hide
|
|
| 203 | | | |
| 204 | [+] | | if (create_cydir(_storage, path) < 0) |
Event 9:
path, which evaluates to list->v.get_path(...) from mailbox-list.c:446, is passed to create_cydir() as the second argument. See related events 3 and 4.
hide
|
|
 |
| |