]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Another attempt at fixing coverity scan CID 361.
authorNick Mathewson <nickm@torproject.org>
Sat, 3 Jan 2009 23:06:12 +0000 (23:06 +0000)
committerNick Mathewson <nickm@torproject.org>
Sat, 3 Jan 2009 23:06:12 +0000 (23:06 +0000)
svn:r17863

src/or/routerlist.c

index a58976a7e9a557899231fb1df09fc29c85431521..ddb488df494fa8f78e1c63c8b5700b1999aca674 100644 (file)
@@ -3295,7 +3295,8 @@ routerlist_remove_old_routers(void)
    * decide to kill routers.) */
   /* XXX021 we don't check if we have a v3 consensus, do we? should we? -RD */
   if (!caches ||
-      smartlist_len(networkstatus_v2_list) > get_n_v2_authorities() / 2) {
+      (networkstatus_v2_list &&
+       smartlist_len(networkstatus_v2_list) > get_n_v2_authorities() / 2)) {
     cutoff = now - ROUTER_MAX_AGE;
     /* Remove too-old unrecommended members of routerlist->routers. */
     for (i = 0; i < smartlist_len(routerlist->routers); ++i) {