diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-01-31 14:34:32 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-01-31 14:34:32 -0500 |
commit | 0f0d4356b21df48f1832c3de606eb70e16e94566 (patch) | |
tree | 5d611213382b51a52c82b2dc0747834d6c81cdbd /src | |
parent | 09a00a2f826233b417066d90dcf5ba9be48b4e13 (diff) | |
download | tor-0f0d4356b21df48f1832c3de606eb70e16e94566.tar.gz tor-0f0d4356b21df48f1832c3de606eb70e16e94566.zip |
Don't try to use confirmed_idx in remove_guard_from_...lists()
Since we can call this function more than once before we update all
the confirmed_idx fields, we can't rely on all the relays having an
accurate confirmed_idx.
Fixes bug 21129; bugfix on 0.3.0.1-alpha
Diffstat (limited to 'src')
-rw-r--r-- | src/or/entrynodes.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/src/or/entrynodes.c b/src/or/entrynodes.c index c5fb92e35a..30a1f4b830 100644 --- a/src/or/entrynodes.c +++ b/src/or/entrynodes.c @@ -1112,18 +1112,7 @@ remove_guard_from_confirmed_and_primary_lists(guard_selection_t *gs, } if (guard->confirmed_idx >= 0) { - entry_guard_t *found_guard = NULL; - if (guard->confirmed_idx < smartlist_len(gs->confirmed_entry_guards)) - found_guard = smartlist_get(gs->confirmed_entry_guards, - guard->confirmed_idx); - if (BUG(guard != found_guard)) { - // LCOV_EXCL_START - smartlist_remove_keeporder(gs->confirmed_entry_guards, guard); - // LCOV_EXCL_STOP - } else { - smartlist_del_keeporder(gs->confirmed_entry_guards, - guard->confirmed_idx); - } + smartlist_remove_keeporder(gs->confirmed_entry_guards, guard); guard->confirmed_idx = -1; guard->confirmed_on_date = 0; } else { |