]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Addressing nits 1777/head
authorDario Pavlovic <dariop@fb.com>
Mon, 9 Sep 2019 23:13:24 +0000 (16:13 -0700)
committerDario Pavlovic <dariop@fb.com>
Mon, 9 Sep 2019 23:13:24 +0000 (16:13 -0700)
tests/fuzz/fuzz_data_producer.h
tests/fuzz/simple_decompress.c

index 4a12e1300c6f6f55b94fe3faca4cb2472e3d547b..4fcf6fd41b936a599b46a29bbb7363d940779741 100644 (file)
@@ -9,6 +9,10 @@
 
 /**
  * Helper APIs for generating random data from input data stream.
+ The producer reads bytes from the end of the input and appends them together
+ to generate  a random number in the requested range. If it runs out of input
+ data, it will keep returning the same value (min) over and over again.
+
  */
 
 #ifndef FUZZ_DATA_PRODUCER_H
index 803f7f8652e523292e4a94ffdd5b7f8c019471b4..a68813ee5f48cdcf52108cebd8ddb12cde250019 100644 (file)
@@ -31,8 +31,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *src, size_t size)
       FUZZ_ASSERT(dctx);
   }
 
-  size_t const bufSize = FUZZ_dataProducer_uint32Range(producer, 0, 2 * size);
-  voidrBuf = malloc(bufSize);
+  size_t const bufSize = FUZZ_dataProducer_uint32Range(producer, 0, 10 * size);
+  void *rBuf = malloc(bufSize);
   FUZZ_ASSERT(rBuf);
 
   /* Restrict to remaining data. If we run out of data while generating params,