(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/master/main.c) |
| |
| 80 | | | static void fatal_log_check(void) |
| 81 | | | { |
| 82 | | | const struct settings *set = settings_root->defaults; |
| 83 | | | const char *path; |
| 84 | | | char buf[1024]; |
| 85 | | | ssize_t ret; |
| 86 | | | int fd; |
| 87 | | | |
| 88 | [+] | | path = t_strconcat(set->base_dir, "/"FATAL_FILENAME, NULL); |
 |
| 89 | | | fd = open(path, O_RDONLY); |
| 90 | | | if (fd == -1) |
Event 8:
Skipping " if". fd == -1 evaluates to false.
hide
|
|
| 91 | | | return; |
| 92 | | | |
| 93 | | | ret = read(fd, buf, sizeof(buf)); |
| 94 | | | if (ret < 0) |
Event 9:
Taking true branch. ret < 0 evaluates to true.
hide
|
|
| 95 | | | i_error("read(%s) failed: %m", path); |
| 96 | | | else { |
| 97 | | | buf[ret] = '\0'; |
| 98 | | | i_warning("Last died with error (see error log for more " |
| 99 | | | "information): %s", buf); |
| 100 | | | } |
| 101 | | | |
| 102 | | | close(fd); |
| 103 | | | if (unlink(path) < 0) |
Event 10:
path, which evaluates to NULL, is passed to unlink(). See related event 6.
hide
Null Pointer Dereference
The body of unlink() dereferences path, but it is NULL. The issue can occur if the highlighted code executes. See related event 10. Show: All events | Only primary events |
|
| |