ref: 07a1df8c3a8609617e679c11dc4ec322095069d7
parent: a48b462e4464c762fac0c8fa0af18d05db2a725f
author: cinap_lenrek <[email protected]>
date: Sat May 30 09:03:05 EDT 2020
imap4d: reject invalid month in date2tm()
--- a/sys/src/cmd/upas/imap4d/date.c
+++ b/sys/src/cmd/upas/imap4d/date.c
@@ -235,6 +235,8 @@
}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;