diff options
author | David Goulet <dgoulet@torproject.org> | 2017-10-26 09:52:15 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2017-10-26 09:52:15 -0400 |
commit | c4ef21ff5eff26182428d388e0614b4f0c5eed58 (patch) | |
tree | 0873acbc9ce8fbfcb75591bbd4d2c02b6e9d429a /src/test/fuzz | |
parent | 4d2de821ce9ab7a79e1a8bf5123adafd4326d023 (diff) | |
download | tor-c4ef21ff5eff26182428d388e0614b4f0c5eed58.tar.gz tor-c4ef21ff5eff26182428d388e0614b4f0c5eed58.zip |
fuzzing: Make hsdescv3 use the decoding API correctly
Fixes #21509
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/test/fuzz')
-rw-r--r-- | src/test/fuzz/fuzz_hsdescv3.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/test/fuzz/fuzz_hsdescv3.c b/src/test/fuzz/fuzz_hsdescv3.c index 3fd21148f4..03c509e2e6 100644 --- a/src/test/fuzz/fuzz_hsdescv3.c +++ b/src/test/fuzz/fuzz_hsdescv3.c @@ -55,10 +55,12 @@ int fuzz_main(const uint8_t *data, size_t sz) { hs_descriptor_t *desc = NULL; + uint8_t subcredential[DIGEST256_LEN]; char *fuzzing_data = tor_memdup_nulterm(data, sz); + memset(subcredential, 'A', sizeof(subcredential)); - hs_desc_decode_descriptor(fuzzing_data, NULL, &desc); + hs_desc_decode_descriptor(fuzzing_data, subcredential, &desc); if (desc) { log_debug(LD_GENERAL, "Decoding okay"); hs_descriptor_free(desc); |