]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix a rare assert trigger, where routerinfos for entries in our cpath
authorRoger Dingledine <arma@torproject.org>
Thu, 30 Sep 2004 15:40:05 +0000 (15:40 +0000)
committerRoger Dingledine <arma@torproject.org>
Thu, 30 Sep 2004 15:40:05 +0000 (15:40 +0000)
would expire while we're building the path.
Thanks to Eugene Armstead for pointing it out.

svn:r2402

src/or/circuitbuild.c

index 7acb876bc5306d862dc05f61c15867be934a33e6..eb4764d156b5864da067223c2e02b53b8a0f997e 100644 (file)
@@ -1083,10 +1083,10 @@ static routerinfo_t *choose_good_middle_server(cpath_build_state_t *state,
     routerlist_add_friends(excluded, r);
   }
   for (i = 0, cpath = head; i < cur_len; ++i, cpath=cpath->next) {
-    r = router_get_by_digest(cpath->identity_digest);
-    tor_assert(r);
-    smartlist_add(excluded, r);
-    routerlist_add_friends(excluded, r);
+    if((r = router_get_by_digest(cpath->identity_digest))) {
+      smartlist_add(excluded, r);
+      routerlist_add_friends(excluded, r);
+    }
   }
   choice = router_choose_random_node("", options.ExcludeNodes, excluded,
            0, 1, options._AllowUnverified & ALLOW_UNVERIFIED_MIDDLE, 0);