summaryrefslogtreecommitdiff
path: root/src/or/networkstatus.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2007-12-22 11:42:12 +0000
committerRoger Dingledine <arma@torproject.org>2007-12-22 11:42:12 +0000
commit87a616e128a4c7e706131b9f4c640f781ce0d3eb (patch)
tree99d22381a3eef28e62991fb9ae383f8c8e31882f /src/or/networkstatus.c
parentabf9fadccac0c5b4f4d93557bf2fce897ee540ed (diff)
downloadtor-87a616e128a4c7e706131b9f4c640f781ce0d3eb.tar.gz
tor-87a616e128a4c7e706131b9f4c640f781ce0d3eb.zip
Fix a crash on startup if you install Tor 0.2.0.13-alpha fresh
without a datadirectory from a previous Tor install. Reported by Zax. svn:r12928
Diffstat (limited to 'src/or/networkstatus.c')
-rw-r--r--src/or/networkstatus.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c
index a2050f137b..6c1a19a1b6 100644
--- a/src/or/networkstatus.c
+++ b/src/or/networkstatus.c
@@ -127,6 +127,8 @@ router_reload_v2_networkstatus(void)
entries = tor_listdir(filename);
tor_free(filename);
+ if (!entries) /* dir doesn't exist */
+ return 0;
SMARTLIST_FOREACH(entries, const char *, fn, {
char buf[DIGEST_LEN];
if (strlen(fn) != HEX_DIGEST_LEN ||