(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/failures.c) |
| |
| 56 | | | static void log_prefix_add(string_t *str) |
| 57 | | | { |
| 58 | | | struct tm *tm; |
| 59 | | | char buf[256]; |
| 60 | | | time_t now; |
| 61 | | | |
| 62 | | | if (log_stamp_format != NULL) { |
Event 1:
Taking true branch. log_stamp_format != (void *)0 evaluates to true.
hide
|
|
| 63 | | | now = time(NULL); |
| 64 | | | tm = localtime(&now); |
Event 2:
localtime() returns NULL. - Dereferenced later, causing the null pointer dereference.
hide
Event 3:
tm is set to localtime(&now), which evaluates to NULL. See related event 2.
hide
|
|
| 65 | | | |
| 66 | | | if (strftime(buf, sizeof(buf), |
Null Pointer Dereference
The body of strftime() dereferences tm, but it is NULL. The issue can occur if the highlighted code executes. See related event 4. Show: All events | Only primary events |
|
| 67 | | | get_log_stamp_format("unused"), tm) > 0) |
Event 4:
tm, which evaluates to NULL, is passed to strftime() as the fourth argument. See related event 3.
hide
|
|
| |