diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-09-11 10:32:17 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-09-11 11:43:26 -0400 |
commit | abaca3fc8c6bc54408084e7514468fa2cd7b3edf (patch) | |
tree | 38ed08599f113c13a7262a90cda1b4a3eb4a3a7d /src/test/test_dir_common.c | |
parent | e014b72b73b2a299068f1ca5b7a22f2bea2f58f8 (diff) | |
download | tor-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_dir_common.c')
-rw-r--r-- | src/test/test_dir_common.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/test/test_dir_common.c b/src/test/test_dir_common.c index e65e2b0111..6e3bb9945d 100644 --- a/src/test/test_dir_common.c +++ b/src/test/test_dir_common.c @@ -264,7 +264,9 @@ dir_common_add_rs_and_parse(networkstatus_t *vote, networkstatus_t **vote_out, /* dump the vote and try to parse it. */ v_text = format_networkstatus_vote(sign_skey, vote); tt_assert(v_text); - *vote_out = networkstatus_parse_vote_from_string(v_text, NULL, NS_TYPE_VOTE); + *vote_out = networkstatus_parse_vote_from_string(v_text, + strlen(v_text), + NULL, NS_TYPE_VOTE); done: if (v_text) @@ -422,4 +424,3 @@ dir_common_construct_vote_3(networkstatus_t **vote, authority_cert_t *cert, return 0; } - |