imap4d: reject invalid month in date2tm()

This commit is contained in:
cinap_lenrek 2020-05-30 13:03:05 +02:00
parent a48b462e44
commit 07a1df8c3a

View file

@ -235,6 +235,8 @@ date2tm(Tm *tm, char *date)
}else{
tm->mday = strtoul(flds[1], nil, 10);
tm->mon = dateindex(flds[2], monname, 12);
if(tm->mon < 0)
return nil;
tm->year = strtoul(flds[3], nil, 10);
if(strlen(flds[3]) > 2)
tm->year -= 1900;