From: Nick Mathewson Date: Thu, 20 Dec 2007 04:54:06 +0000 (+0000) Subject: r17268@catbus: nickm | 2007-12-19 23:53:53 -0500 X-Git-Tag: tor-0.2.0.13-alpha~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5c33c0632ef2c2094705024b4068fa3d58cce553;p=thirdparty%2Ftor.git 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. svn:r12881 --- diff --git a/ChangeLog b/ChangeLog index bbc2ae1368..20c31191f0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -85,6 +85,7 @@ Changes in version 0.2.0.13-alpha - 2007-12-?? - 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 diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c index e2f3d9281b..28d0010ff7 100644 --- a/src/or/networkstatus.c +++ b/src/or/networkstatus.c @@ -203,6 +203,13 @@ router_reload_consensus_networkstatus(void) } } + 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;