(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/index/maildir/maildir-storage.c) |
| |
| 302 | | | static int mkdir_verify(struct mail_storage *storage, const char *dir, |
| 303 | | | mode_t mode, gid_t gid, const char *gid_origin, |
| 304 | | | bool verify) |
| 305 | | | { |
| 306 | | | struct stat st; |
| 307 | | | |
| 308 | | | if (verify) { |
Event 1:
Taking true branch. verify evaluates to true.
hide
|
|
| 309 | | | if (stat(dir, &st) == 0) |
Event 2:
dir is passed to stat64() as the first argument.
hide
Event 3:
stat64() accesses the file named dir. - 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 2.
hide
Event 4:
Skipping " if". stat(dir, &st) == 0 evaluates to false.
hide
|
|
| 310 | | | return 0; |
| 311 | | | |
| 312 | | | if (errno != ENOENT) {
x /usr/include/asm-generic/errno-base.h |
| |
5 | #define ENOENT 2 /* No such file or directory */ |
| |
|
Event 5:
Skipping " if". errno != 2 evaluates to false.
hide
|
|
| 313 | | | mail_storage_set_critical(storage, |
| 314 | | | "stat(%s) failed: %m", dir); |
| 315 | | | return -1; |
| 316 | | | } |
| 317 | | | } |
| 318 | | | |
| 319 | [+] | | if (mkdir_parents_chgrp(dir, mode, gid, gid_origin) == 0) |
Event 6:
dir is passed to mkdir_parents_chgrp() as the first argument.
hide
|
|
 |
| |