diff options
author | Sebastian Hahn <sebastian@torproject.org> | 2012-03-09 15:40:44 +0100 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-05-16 12:15:13 -0400 |
commit | 679aa93e23f2c7f2e9c195f08834a7fc8c8d8b29 (patch) | |
tree | 1dcaab87a12695088d3c607d11f888c64031e68d /src/common/util.c | |
parent | 801923ac2112d1a54eaf4126800724bea90055eb (diff) | |
download | tor-679aa93e23f2c7f2e9c195f08834a7fc8c8d8b29.tar.gz tor-679aa93e23f2c7f2e9c195f08834a7fc8c8d8b29.zip |
Fix month check in parse_http_time, add test
Diffstat (limited to 'src/common/util.c')
-rw-r--r-- | src/common/util.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/common/util.c b/src/common/util.c index 5fa0896ae5..a03a576321 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -1451,6 +1451,8 @@ parse_http_time(const char *date, struct tm *tm) month[3] = '\0'; /* Okay, now decode the month. */ + /* set tm->tm_mon to dummy value so the check below fails. */ + tm->tm_mon = -1; for (i = 0; i < 12; ++i) { if (!strcasecmp(MONTH_NAMES[i], month)) { tm->tm_mon = i; |