From 07a1df8c3a8609617e679c11dc4ec322095069d7 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sat, 30 May 2020 13:03:05 +0200 Subject: imap4d: reject invalid month in date2tm() --- sys/src/cmd/upas/imap4d/date.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/src/cmd/upas/imap4d/date.c b/sys/src/cmd/upas/imap4d/date.c index 9692203ca..69900db4f 100644 --- a/sys/src/cmd/upas/imap4d/date.c +++ b/sys/src/cmd/upas/imap4d/date.c @@ -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; -- cgit v1.2.3