diff options
author | Roger Dingledine <arma@torproject.org> | 2004-09-30 15:40:05 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2004-09-30 15:40:05 +0000 |
commit | eff780c815d1f5ffdc25cf15db7282e6e7f61e8c (patch) | |
tree | 766b65df33eb4a378b1c9d3957b182919d63a9fc /src/or/circuitbuild.c | |
parent | 136d4e573913480491e0c45ffe7ff6450cb107af (diff) | |
download | tor-eff780c815d1f5ffdc25cf15db7282e6e7f61e8c.tar tor-eff780c815d1f5ffdc25cf15db7282e6e7f61e8c.tar.gz |
Fix a rare assert trigger, where routerinfos for entries in our cpath
would expire while we're building the path.
Thanks to Eugene Armstead for pointing it out.
svn:r2402
Diffstat (limited to 'src/or/circuitbuild.c')
-rw-r--r-- | src/or/circuitbuild.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index 7acb876bc..eb4764d15 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -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); |