[tor-commits] [tor/release-0.2.7] Assert that dircollator is collated when we're reading its output.
nickm at torproject.org
nickm at torproject.org
Mon Mar 21 17:27:37 UTC 2016
commit beef6ed45160f096815b4ea840ff671fb484d1da
Author: Nick Mathewson <nickm at torproject.org>
Date: Tue Mar 15 10:24:18 2016 -0400
Assert that dircollator is collated when we're reading its output.
Fix for 17668.S2.
---
src/or/dircollate.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/or/dircollate.c b/src/or/dircollate.c
index ca8b7ca..2f02512 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));
More information about the tor-commits
mailing list