aboutsummaryrefslogtreecommitdiff
path: root/src/or/dircollate.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-03-15 10:24:18 -0400
committerNick Mathewson <nickm@torproject.org>2016-03-21 13:24:09 -0400
commitbeef6ed45160f096815b4ea840ff671fb484d1da (patch)
treebb5ef248e91a400d2a695afa4bc514758c0ff3df /src/or/dircollate.c
parent48f8229504a00085676a737d9b519548ffc9d145 (diff)
downloadtor-beef6ed45160f096815b4ea840ff671fb484d1da.tar.gz
tor-beef6ed45160f096815b4ea840ff671fb484d1da.zip
Assert that dircollator is collated when we're reading its output.
Fix for 17668.S2.
Diffstat (limited to 'src/or/dircollate.c')
-rw-r--r--src/or/dircollate.c2
1 files changed, 2 insertions, 0 deletions
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));