(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/master/main.c) |
| |
| 248 | | | static void create_pid_file(const char *path) |
| 249 | | | { |
| 250 | | | const char *pid; |
| 251 | | | int fd; |
| 252 | | | |
| 253 | [+] | | pid = t_strconcat(dec2str(getpid()), "\n", NULL); |
 |
| 254 | | | |
| 255 | | | fd = open(path, O_WRONLY|O_CREAT|O_TRUNC, 0644);
x /usr/include/bits/fcntl.h |
| |
38 | #define O_CREAT 0100 /* not fcntl */ |
| |
x /usr/include/bits/fcntl.h |
| |
41 | #define O_TRUNC 01000 /* not fcntl */ |
| |
|
| 256 | | | if (fd == -1) |
Event 8:
Skipping " if". fd == -1 evaluates to false.
hide
|
|
| 257 | | | i_fatal("open(%s) failed: %m", path); |
| 258 | | | if (write_full(fd, pid, strlen(pid)) < 0) |
Event 9:
pid, which evaluates to NULL, is passed to __builtin_strlen(). See related event 6.
hide
Null Pointer Dereference
The body of __builtin_strlen() dereferences pid, but it is NULL. The issue can occur if the highlighted code executes. See related event 9. Show: All events | Only primary events |
|
| |