(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/index/dbox/dbox-storage.c) |
| |
| 346 | | | static int dbox_mailbox_create(struct mail_storage *_storage, |
| 347 | | | const char *name, bool directory) |
| 348 | | | { |
| 349 | | | struct dbox_storage *storage = (struct dbox_storage *)_storage; |
| 350 | | | const char *path, *alt_path; |
| 351 | | | struct stat st; |
| 352 | | | |
| 353 | | | 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
|
|
| 354 | | | directory ? MAILBOX_LIST_PATH_TYPE_DIR : |
Event 1:
directory evaluates to true.
hide
|
|
| 355 | [+] | | MAILBOX_LIST_PATH_TYPE_MAILBOX); |
 |
| 356 | | | 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:
Skipping " if". stat(path, &st) == 0 evaluates to false.
hide
|
|
| 357 | | | mail_storage_set_error(_storage, MAIL_ERROR_EXISTS, |
| 358 | | | "Mailbox already exists"); |
| 359 | | | return -1; |
| 360 | | | } |
| 361 | | | |
| 362 | | | |
| 363 | | | |
| 364 | | | |
| 365 | | | |
| 366 | | | alt_path = directory ? NULL : dbox_get_alt_path(storage, path); |
Event 7:
directory evaluates to true.
hide
|
|
| 367 | | | if (alt_path != NULL && stat(alt_path, &st) == 0) { |
Event 8:
Skipping " if". alt_path != (void *)0 evaluates to false.
hide
|
|
| 368 | | | mail_storage_set_error(_storage, MAIL_ERROR_EXISTS, |
| 369 | | | "Mailbox already exists"); |
| 370 | | | return -1; |
| 371 | | | } |
| 372 | | | |
| 373 | [+] | | return create_dbox(_storage, path); |
Event 9:
path, which evaluates to list->v.get_path(...) from mailbox-list.c:446, is passed to create_dbox() as the second argument. See related events 3 and 4.
hide
|
|
 |
| |