From 57d51be60c0bb299a30ae5b4c66d9a7113e7586b Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 21 Jun 2011 23:18:05 +0200 Subject: parsedate: detect more invalid dates better --- lib/parsedate.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/parsedate.c') diff --git a/lib/parsedate.c b/lib/parsedate.c index 6865f8e40..62f1a4181 100644 --- a/lib/parsedate.c +++ b/lib/parsedate.c @@ -485,6 +485,10 @@ static int parsedate(const char *date, time_t *output) return PARSEDATE_SOONER; } + if((mdaynum > 31) || (monnum > 11) || + (hournum > 23) || (minnum > 59) || (secnum > 60)) + return PARSEDATE_FAIL; /* clearly an illegal date */ + tm.tm_sec = secnum; tm.tm_min = minnum; tm.tm_hour = hournum; -- cgit v1.2.3