aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_routerlist.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-09-11 10:32:17 -0400
committerNick Mathewson <nickm@torproject.org>2018-09-11 11:43:26 -0400
commitabaca3fc8c6bc54408084e7514468fa2cd7b3edf (patch)
tree38ed08599f113c13a7262a90cda1b4a3eb4a3a7d /src/test/test_routerlist.c
parente014b72b73b2a299068f1ca5b7a22f2bea2f58f8 (diff)
downloadtor-abaca3fc8c6bc54408084e7514468fa2cd7b3edf.tar.gz
tor-abaca3fc8c6bc54408084e7514468fa2cd7b3edf.zip
Revise networkstatus parsing code to use lengths
This way the networkstatus can be parsed without being NUL-terminated, so we can implement 27244 and mmap our consensus objects.
Diffstat (limited to 'src/test/test_routerlist.c')
-rw-r--r--src/test/test_routerlist.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/test/test_routerlist.c b/src/test/test_routerlist.c
index 89d1f4f90f..7fe4c15b18 100644
--- a/src/test/test_routerlist.c
+++ b/src/test/test_routerlist.c
@@ -270,7 +270,9 @@ test_router_pick_directory_server_impl(void *arg)
construct_consensus(&consensus_text_md, now);
tt_assert(consensus_text_md);
- con_md = networkstatus_parse_vote_from_string(consensus_text_md, NULL,
+ con_md = networkstatus_parse_vote_from_string(consensus_text_md,
+ strlen(consensus_text_md),
+ NULL,
NS_TYPE_CONSENSUS);
tt_assert(con_md);
tt_int_op(con_md->flavor,OP_EQ, FLAV_MICRODESC);