]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
[fuzz] Fix leak in block_round_trip 1789/head
authorNick Terrell <terrelln@fb.com>
Fri, 13 Sep 2019 17:32:38 +0000 (10:32 -0700)
committerNick Terrell <terrelln@fb.com>
Fri, 13 Sep 2019 17:32:38 +0000 (10:32 -0700)
tests/fuzz/block_round_trip.c

index 0f948d4fcf807d2662b5e2322efb88b394604205..89f060a6eb3825a8ad9db9244c0209e376200247 100644 (file)
@@ -60,7 +60,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *src, size_t size)
 
     size_t neededBufSize = size;
     if (size > ZSTD_BLOCKSIZE_MAX)
-        return 0;
+        size = ZSTD_BLOCKSIZE_MAX;
 
     /* Allocate all buffers and contexts if not already allocated */
     if (neededBufSize > bufSize || !cBuf || !rBuf) {