diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-10-31 09:04:12 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-10-31 09:04:12 -0400 |
commit | 988d4903a3fc23153896e0daf7738f87ade9bc4b (patch) | |
tree | 79f9eb5ca1154c058d5243b0cd43a6ac1905757f /src/test/fuzz/fuzz_consensus.c | |
parent | a182301152afe9cd066516ae02f588840b2efc43 (diff) | |
parent | 594140574e7366efac693d440a636a1e1cce82ff (diff) | |
download | tor-988d4903a3fc23153896e0daf7738f87ade9bc4b.tar.gz tor-988d4903a3fc23153896e0daf7738f87ade9bc4b.zip |
Merge branch 'networkstatus_mmap' into networkstatus_mmap_merge
Diffstat (limited to 'src/test/fuzz/fuzz_consensus.c')
-rw-r--r-- | src/test/fuzz/fuzz_consensus.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/test/fuzz/fuzz_consensus.c b/src/test/fuzz/fuzz_consensus.c index b56702a650..1a4195b418 100644 --- a/src/test/fuzz/fuzz_consensus.c +++ b/src/test/fuzz/fuzz_consensus.c @@ -61,13 +61,13 @@ int fuzz_main(const uint8_t *data, size_t sz) { networkstatus_t *ns; - char *str = tor_memdup_nulterm(data, sz); const char *eos = NULL; networkstatus_type_t tp = NS_TYPE_CONSENSUS; if (tor_memstr(data, MIN(sz, 1024), "tus vote")) tp = NS_TYPE_VOTE; const char *what = (tp == NS_TYPE_CONSENSUS) ? "consensus" : "vote"; - ns = networkstatus_parse_vote_from_string(str, + ns = networkstatus_parse_vote_from_string((const char *)data, + sz, &eos, tp); if (ns) { @@ -76,6 +76,6 @@ fuzz_main(const uint8_t *data, size_t sz) } else { log_debug(LD_GENERAL, "Parsing as %s failed", what); } - tor_free(str); + return 0; } |