(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/index/cydir/cydir-storage.c) |
| |
| 345 | | | static int cydir_list_iter_is_mailbox(struct mailbox_list_iterate_context *ctx |
| 346 | | | ATTR_UNUSED, |
| 347 | | | const char *dir, const char *fname, |
| 348 | | | const char *mailbox_name ATTR_UNUSED, |
| 349 | | | enum mailbox_list_file_type type, |
| 350 | | | enum mailbox_info_flags *flags) |
| 351 | | | { |
| 352 | | | const char *mail_path; |
| 353 | | | struct stat st; |
| 354 | | | int ret = 1; |
| 355 | | | |
| 356 | | | |
| 357 | | | if (type != MAILBOX_LIST_FILE_TYPE_DIR && |
Event 1:
Skipping " if". type != MAILBOX_LIST_FILE_TYPE_DIR evaluates to false.
hide
|
|
| 358 | | | type != MAILBOX_LIST_FILE_TYPE_SYMLINK && |
| 359 | | | type != MAILBOX_LIST_FILE_TYPE_UNKNOWN) { |
| 360 | | | |
| 361 | | | *flags |= MAILBOX_NOSELECT | MAILBOX_NOINFERIORS; |
| 362 | | | return 0; |
| 363 | | | } |
| 364 | | | |
| 365 | | | |
| 366 | [+] | | mail_path = t_strconcat(dir, "/", fname, NULL); |
 |
| 367 | | | if (stat(mail_path, &st) == 0) { |
Event 8:
mail_path, which evaluates to NULL, is passed to stat64() as the first argument. See related event 7.
hide
Null Pointer Dereference
The body of stat64() dereferences mail_path, but it is NULL. The issue can occur if the highlighted code executes. See related event 8. Show: All events | Only primary events |
|
| |