Skip to content
Snippets Groups Projects
Commit 83fd75ff authored by rswindell's avatar rswindell
Browse files

Fix crash (NULL deref) when locatime() fails.

parent 05f30090
No related branches found
No related tags found
No related merge requests found
......@@ -3649,10 +3649,10 @@ void export_echomail(char *sub_code,faddr_t addr)
SAFECOPY(hdr.from,msg.from);
tt=msg.hdr.when_written.time;
tm=localtime(&tt);
sprintf(hdr.time,"%02u %3.3s %02u %02u:%02u:%02u"
,tm->tm_mday,mon[tm->tm_mon],TM_YEAR(tm->tm_year)
,tm->tm_hour,tm->tm_min,tm->tm_sec);
if((tm=localtime(&tt)) != NULL)
sprintf(hdr.time,"%02u %3.3s %02u %02u:%02u:%02u"
,tm->tm_mday,mon[tm->tm_mon],TM_YEAR(tm->tm_year)
,tm->tm_hour,tm->tm_min,tm->tm_sec);
SAFECOPY(hdr.to,msg.to);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment