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

[or-cvs] r17863: {tor} Another attempt at fixing coverity scan CID 361. (tor/trunk/src/or)



Author: nickm
Date: 2009-01-03 18:06:12 -0500 (Sat, 03 Jan 2009)
New Revision: 17863

Modified:
   tor/trunk/src/or/routerlist.c
Log:
Another attempt at fixing coverity scan CID 361.

Modified: tor/trunk/src/or/routerlist.c
===================================================================
--- tor/trunk/src/or/routerlist.c	2009-01-03 23:06:08 UTC (rev 17862)
+++ tor/trunk/src/or/routerlist.c	2009-01-03 23:06:12 UTC (rev 17863)
@@ -3295,7 +3295,8 @@
    * 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) {