From 1abe533b3304619bd8c59f170097ab469af99dc9 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 8 Mar 2012 21:09:34 -0500 Subject: Reject an additional type of bad date in parse_http_time --- src/common/util.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/common/util.c') diff --git a/src/common/util.c b/src/common/util.c index 391b02f34b..c44fe601e7 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -1416,7 +1416,10 @@ parse_http_time(const char *date, struct tm *tm) /* First, try RFC1123 or RFC850 format: skip the weekday. */ if ((cp = strchr(date, ','))) { - cp += 2; + ++cp; + if (*cp != ' ') + return -1; + ++cp; if (tor_sscanf(cp, "%2u %3s %4u %2u:%2u:%2u GMT", &tm_mday, month, &tm_year, &tm_hour, &tm_min, &tm_sec) == 6) { -- cgit v1.2.3-54-g00ecf