]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix crash bug (3361) when setting off-flavor networkstatus
authorNick Mathewson <nickm@torproject.org>
Tue, 7 Jun 2011 18:46:28 +0000 (14:46 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 7 Jun 2011 18:46:28 +0000 (14:46 -0400)
When we set a networkstatus in the non-preferred flavor, we'd check
the time in the current_consensus.  But that might have been NULL,
which could produce a crash as seen in bug 3361.

changes/bug3361 [new file with mode: 0644]
src/or/networkstatus.c

diff --git a/changes/bug3361 b/changes/bug3361
new file mode 100644 (file)
index 0000000..06bd954
--- /dev/null
@@ -0,0 +1,4 @@
+  o Major bugfixes:
+    - Fix a crash bug that could occur when setting a consensus in a
+      non-used flavor without having a current consensus set. Fixes bug
+      3361; bugfix on 0.2.3.1-alpha.
index 837c8c2bf2679df6b81a5f62481c3cf3b3d620c9..ab1358bca9496f34bd9ba55a660d521d62674a3d 100644 (file)
@@ -1814,7 +1814,7 @@ networkstatus_set_current_consensus(const char *consensus,
  * valid-after time, declare that our clock is skewed. */
 #define EARLY_CONSENSUS_NOTICE_SKEW 60
 
-  if (now < current_consensus->valid_after - EARLY_CONSENSUS_NOTICE_SKEW) {
+  if (now < c->valid_after - EARLY_CONSENSUS_NOTICE_SKEW) {
     char tbuf[ISO_TIME_LEN+1];
     char dbuf[64];
     long delta = now - c->valid_after;