From: Nick Mathewson Date: Tue, 15 Mar 2016 14:24:18 +0000 (-0400) Subject: Assert that dircollator is collated when we're reading its output. X-Git-Tag: tor-0.2.8.2-alpha~48^2^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=beef6ed45160f096815b4ea840ff671fb484d1da;p=thirdparty%2Ftor.git Assert that dircollator is collated when we're reading its output. Fix for 17668.S2. --- diff --git a/src/or/dircollate.c b/src/or/dircollate.c index ca8b7ca847..2f02512d3e 100644 --- a/src/or/dircollate.c +++ b/src/or/dircollate.c @@ -303,6 +303,7 @@ dircollator_collate_by_ed25519(dircollator_t *dc) int dircollator_n_routers(dircollator_t *dc) { + tor_assert(dc->is_collated); return smartlist_len(dc->all_rsa_sha1_lst); } @@ -317,6 +318,7 @@ dircollator_n_routers(dircollator_t *dc) vote_routerstatus_t ** dircollator_get_votes_for_router(dircollator_t *dc, int idx) { + tor_assert(dc->is_collated); tor_assert(idx < smartlist_len(dc->all_rsa_sha1_lst)); return digestmap_get(dc->by_collated_rsa_sha1, smartlist_get(dc->all_rsa_sha1_lst, idx));