aboutsummaryrefslogtreecommitdiff
path: root/src/or/dirvote.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-09-11 13:21:20 -0400
committerNick Mathewson <nickm@torproject.org>2012-09-11 13:21:20 -0400
commitf8a665c87d21b3bf4325c0c7f369b4ec3fbedd98 (patch)
tree3c4f3d4d6efe5e0843fac87f6e475f615300e902 /src/or/dirvote.c
parent99cb9696ac617a42a78d9ebfa3f169fd8e4a3d88 (diff)
parent5833861f62d2667eeda1ed0f6595763aa00250b0 (diff)
downloadtor-f8a665c87d21b3bf4325c0c7f369b4ec3fbedd98.tar
tor-f8a665c87d21b3bf4325c0c7f369b4ec3fbedd98.tar.gz
Merge remote-tracking branch 'origin/maint-0.2.3'
Diffstat (limited to 'src/or/dirvote.c')
-rw-r--r--src/or/dirvote.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/or/dirvote.c b/src/or/dirvote.c
index ea85636b3..b1b885cf3 100644
--- a/src/or/dirvote.c
+++ b/src/or/dirvote.c
@@ -2546,7 +2546,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;
@@ -2555,7 +2555,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;