summaryrefslogtreecommitdiff
path: root/src/test/fuzz
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-11-06 13:01:56 -0500
committerNick Mathewson <nickm@torproject.org>2017-11-06 13:01:56 -0500
commit0227aab1b7084de271cfb7702cb3386bfb05a5bb (patch)
tree3192a0d369e3ff1e44f4d048131ecd1dda9a5bce /src/test/fuzz
parent02a4c641da4497b77ded4123c4550a583916eff2 (diff)
parent7d767706ef9d46738028ed3990d638283929fd85 (diff)
downloadtor-0227aab1b7084de271cfb7702cb3386bfb05a5bb.tar.gz
tor-0227aab1b7084de271cfb7702cb3386bfb05a5bb.zip
Merge branch 'maint-0.3.2'
Diffstat (limited to 'src/test/fuzz')
-rw-r--r--src/test/fuzz/fuzz_hsdescv3.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/test/fuzz/fuzz_hsdescv3.c b/src/test/fuzz/fuzz_hsdescv3.c
index 30e82c9252..428774e330 100644
--- a/src/test/fuzz/fuzz_hsdescv3.c
+++ b/src/test/fuzz/fuzz_hsdescv3.c
@@ -50,7 +50,13 @@ mock_decrypt_desc_layer(const hs_descriptor_t *desc,
*decrypted_out = tor_memdup_nulterm(
encrypted_blob + HS_DESC_ENCRYPTED_SALT_LEN,
encrypted_blob_size - overhead);
- return strlen(*decrypted_out);
+ size_t result = strlen(*decrypted_out);
+ if (result) {
+ return result;
+ } else {
+ tor_free(*decrypted_out);
+ return 0;
+ }
}
int