diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-09-11 10:41:59 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-09-11 13:13:07 -0400 |
commit | 973c18bf0e84d14d8006a9ae97fde7f7fb97e404 (patch) | |
tree | 4f8172e13883e45ecff9295737cc82e20dac3602 /src/or/dirvote.c | |
parent | 1c30e6abc93fa086a14d01d838066581a3657285 (diff) | |
download | tor-973c18bf0e84d14d8006a9ae97fde7f7fb97e404.tar.gz tor-973c18bf0e84d14d8006a9ae97fde7f7fb97e404.zip |
Fix assertion failure in tor_timegm.
Fixes bug 6811.
Diffstat (limited to 'src/or/dirvote.c')
-rw-r--r-- | src/or/dirvote.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/or/dirvote.c b/src/or/dirvote.c index ab08fd0200..a557fc782e 100644 --- a/src/or/dirvote.c +++ b/src/or/dirvote.c @@ -2536,7 +2536,7 @@ time_t dirvote_get_start_of_next_interval(time_t now, int interval) { struct tm tm; - time_t midnight_today; + time_t midnight_today=0; time_t midnight_tomorrow; time_t next; @@ -2545,7 +2545,9 @@ dirvote_get_start_of_next_interval(time_t now, int interval) tm.tm_min = 0; tm.tm_sec = 0; - midnight_today = tor_timegm(&tm); + if (tor_timegm(&tm, &midnight_today) < 0) { + log_warn(LD_BUG, "Ran into an invalid time when trying to find midnight."); + } midnight_tomorrow = midnight_today + (24*60*60); next = midnight_today + ((now-midnight_today)/interval + 1)*interval; |