[or-cvs] [tor/master] Don't crash when reading cached*consensus files on startup

nickm at torproject.org nickm at torproject.org
Thu Jun 10 15:29:20 UTC 2010


Author: Sebastian Hahn <sebastian at torproject.org>
Date: Thu, 10 Jun 2010 16:18:26 +0200
Subject: Don't crash when reading cached*consensus files on startup
Commit: f7b40f45b733f3a9a483e764b742eb5b5148ce1a

Fixes bug 1352
---
 changes/bug1532  |    4 ++++
 src/or/dirserv.c |    2 ++
 2 files changed, 6 insertions(+), 0 deletions(-)
 create mode 100644 changes/bug1532

diff --git a/changes/bug1532 b/changes/bug1532
new file mode 100644
index 0000000..ed26904
--- /dev/null
+++ b/changes/bug1532
@@ -0,0 +1,4 @@
+ o Major bugfixes
+   - Tor directory authorities no longer crash when started with a
+     cached-microdesc-consensus file in their data directory. Bugfix on
+     0.2.2.6-alpha, fixes bug 1532.
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index 8b21501..24b4d54 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -1597,6 +1597,8 @@ dirserv_get_runningrouters(void)
 cached_dir_t *
 dirserv_get_consensus(const char *flavor_name)
 {
+  if (!cached_consensuses)
+    return NULL;
   return strmap_get(cached_consensuses, flavor_name);
 }
 
-- 
1.6.5



More information about the tor-commits mailing list