(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/util/rawlog.c) |
| |
| 210 | | | static void proxy_open_logs(struct rawlog_proxy *proxy, const char *path) |
| 211 | | | { |
| 212 | | | time_t now; |
| 213 | | | struct tm *tm; |
| 214 | | | const char *fname; |
| 215 | | | char timestamp[50]; |
| 216 | | | |
| 217 | | | now = time(NULL); |
| 218 | | | tm = localtime(&now); |
Event 1:
localtime() returns NULL. - Dereferenced later, causing the null pointer dereference.
hide
Event 2:
tm is set to localtime(&now), which evaluates to NULL. See related event 1.
hide
|
|
| 219 | | | if (strftime(timestamp, sizeof(timestamp), "%Y%m%d-%H%M%S", tm) <= 0) |
Event 3:
tm, which evaluates to NULL, is passed to strftime() as the fourth argument. See related event 2.
hide
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 3. Show: All events | Only primary events |
|
| |