diff options
author | Daniel Stenberg <daniel@haxx.se> | 2011-06-21 23:18:05 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2011-06-23 13:49:29 +0200 |
commit | 57d51be60c0bb299a30ae5b4c66d9a7113e7586b (patch) | |
tree | 9b16c665f94f51cf56d519972c3796d68f292f66 /lib | |
parent | 8da5da9b6544337b8a675db092da201f279265d4 (diff) |
parsedate: detect more invalid dates better
Diffstat (limited to 'lib')
-rw-r--r-- | lib/parsedate.c | 4 |
1 files changed, 4 insertions, 0 deletions
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; |