aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-03-08 21:09:34 -0500
committerNick Mathewson <nickm@torproject.org>2012-05-16 12:14:48 -0400
commit1abe533b3304619bd8c59f170097ab469af99dc9 (patch)
treec4be4391d89f0e7958378a9203cdc3cf9ccad1b2 /src/common
parentd0d9c3d71e1fb88557d684c59cf8a920712b16f1 (diff)
downloadtor-1abe533b3304619bd8c59f170097ab469af99dc9.tar
tor-1abe533b3304619bd8c59f170097ab469af99dc9.tar.gz
Reject an additional type of bad date in parse_http_time
Diffstat (limited to 'src/common')
-rw-r--r--src/common/util.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/common/util.c b/src/common/util.c
index 391b02f34..c44fe601e 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) {