[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r12881: Initialize [un]named_server_map to empty strmaps when router (in tor/trunk: . src/or)



Author: nickm
Date: 2007-12-19 23:54:06 -0500 (Wed, 19 Dec 2007)
New Revision: 12881

Modified:
   tor/trunk/
   tor/trunk/ChangeLog
   tor/trunk/src/or/networkstatus.c
Log:
 r17268@catbus:  nickm | 2007-12-19 23:53:53 -0500
 Initialize [un]named_server_map to empty strmaps when router_reload_consensus_networkstatus fails completely.  Resolves bug 538.



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r17268] on 8246c3cf-6607-4228-993b-4d95d33730f1

Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2007-12-20 04:50:00 UTC (rev 12880)
+++ tor/trunk/ChangeLog	2007-12-20 04:54:06 UTC (rev 12881)
@@ -85,6 +85,7 @@
     - Fix compilation with --disable-threads set.
     - Authorities decide whether they're authoritative for a given router
       based on the router's purpose.
+    - Don't crash on name lookup when we have no current consensus.
 
   o Minor features:
     - On USR1, when dmalloc is in use, log the top 10 memory

Modified: tor/trunk/src/or/networkstatus.c
===================================================================
--- tor/trunk/src/or/networkstatus.c	2007-12-20 04:50:00 UTC (rev 12880)
+++ tor/trunk/src/or/networkstatus.c	2007-12-20 04:54:06 UTC (rev 12881)
@@ -203,6 +203,13 @@
     }
   }
 
+  if (!current_consensus) {
+    if (!named_server_map)
+      named_server_map = strmap_new();
+    if (!unnamed_server_map)
+      unnamed_server_map = strmap_new();
+  }
+
   routers_update_all_from_networkstatus(time(NULL), 3);
 
   return 0;