diff options
author | Yann Collet <Cyan4973@users.noreply.github.com> | 2022-07-11 09:53:38 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-11 09:53:38 (GMT) |
commit | 33b20f24b4d279e9bfae4ea85ac92b01e00fa873 (patch) | |
tree | f72179adfc64170a6c116a9d636f6ca2ee6b7944 | |
parent | 0b0e3330bcc62b8582ce6fee3a7465391f7b56c7 (diff) | |
parent | 34f25c3c1d34249c2ef029449360fd8c4110faf7 (diff) | |
download | lz4-33b20f24b4d279e9bfae4ea85ac92b01e00fa873.zip lz4-33b20f24b4d279e9bfae4ea85ac92b01e00fa873.tar.gz lz4-33b20f24b4d279e9bfae4ea85ac92b01e00fa873.tar.bz2 |
Merge pull request #1103 from lz4/fix_fuzzer_leak
fixed direct-leak in round_trip_fuzzer.c
-rw-r--r-- | ossfuzz/round_trip_fuzzer.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ossfuzz/round_trip_fuzzer.c b/ossfuzz/round_trip_fuzzer.c index 2c35d9a..6236201 100644 --- a/ossfuzz/round_trip_fuzzer.c +++ b/ossfuzz/round_trip_fuzzer.c @@ -23,13 +23,13 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) size_t const largeSize = 64 * 1024 - 1; size_t const smallSize = 1024; char* const dstPlusLargePrefix = (char*)malloc(dstCapacity + largeSize); + FUZZ_ASSERT(dstPlusLargePrefix); char* const dstPlusSmallPrefix = dstPlusLargePrefix + largeSize - smallSize; char* const largeDict = (char*)malloc(largeSize); + FUZZ_ASSERT(largeDict); char* const smallDict = largeDict + largeSize - smallSize; char* const dst = dstPlusLargePrefix + largeSize; char* const rt = (char*)malloc(size); - - FUZZ_ASSERT(dst); FUZZ_ASSERT(rt); /* Compression must succeed and round trip correctly. */ @@ -109,6 +109,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) } free(dstPlusLargePrefix); + free(largeDict); free(rt); FUZZ_dataProducer_free(producer); |