summaryrefslogtreecommitdiff
path: root/src/common/util.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-05-05 10:49:55 -0400
committerNick Mathewson <nickm@torproject.org>2016-05-12 14:37:27 -0400
commite57f26c135b03f5dbde77aea24551b6a9fc20889 (patch)
tree9059812aca333977f2a3f5dcf42b22eb92e483f6 /src/common/util.c
parent97c6e717b9f3f198163c6d5b4bde86e7f3da28d0 (diff)
downloadtor-e57f26c135b03f5dbde77aea24551b6a9fc20889.tar.gz
tor-e57f26c135b03f5dbde77aea24551b6a9fc20889.zip
Have correct_tm set tm_wday as well.
The tm_wday field had been left uninitialized, which was causing some assertions to fail on Windows unit tests. Fixes bug 18977.
Diffstat (limited to 'src/common/util.c')
-rw-r--r--src/common/util.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/common/util.c b/src/common/util.c
index 5eb0f9a69b..31dc2a4ec1 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -1460,6 +1460,7 @@ parse_iso_time(const char *cp, time_t *t)
st_tm.tm_hour = hour;
st_tm.tm_min = minute;
st_tm.tm_sec = second;
+ st_tm.tm_wday = 0; /* Should be ignored. */
if (st_tm.tm_year < 70) {
char *esc = esc_for_log(cp);
@@ -1517,6 +1518,7 @@ parse_http_time(const char *date, struct tm *tm)
tm->tm_hour = (int)tm_hour;
tm->tm_min = (int)tm_min;
tm->tm_sec = (int)tm_sec;
+ tm->tm_wday = 0; /* Leave this unset. */
month[3] = '\0';
/* Okay, now decode the month. */