summaryrefslogtreecommitdiffstats
path: root/ossfuzz/round_trip_fuzzer.c
diff options
context:
space:
mode:
authorBimba Shrestha <bshrestha.msae@gmail.com>2019-09-13 21:07:52 (GMT)
committerBimba Shrestha <bshrestha.msae@gmail.com>2019-09-13 21:07:52 (GMT)
commit208694297a308da8dae2b3bb104bdab486d1b683 (patch)
tree95930ec739b3e8d45be17732f5ef7d82bb584b23 /ossfuzz/round_trip_fuzzer.c
parent7d153a704d00a266c9601c947e07fd33e1cd6f4d (diff)
downloadlz4-208694297a308da8dae2b3bb104bdab486d1b683.zip
lz4-208694297a308da8dae2b3bb104bdab486d1b683.tar.gz
lz4-208694297a308da8dae2b3bb104bdab486d1b683.tar.bz2
Seperating the seed generation and use
Diffstat (limited to 'ossfuzz/round_trip_fuzzer.c')
-rw-r--r--ossfuzz/round_trip_fuzzer.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ossfuzz/round_trip_fuzzer.c b/ossfuzz/round_trip_fuzzer.c
index e37a0a6..85774fe 100644
--- a/ossfuzz/round_trip_fuzzer.c
+++ b/ossfuzz/round_trip_fuzzer.c
@@ -15,7 +15,9 @@
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
{
FUZZ_dataProducer_t *producer = FUZZ_dataProducer_create(data, size);
- size_t const partialCapacity = FUZZ_dataProducer_uint32(producer, 0, size);
+ size_t const partialCapacitySeed = FUZZ_dataProducer_uint32_seed(producer, 0, size);
+ size_t const partialCapacity = FUZZ_dataProducer_uint32(partialCapacitySeed,
+ 0, FUZZ_dataProducer_remainingBytes(producer));
size_t const dstCapacity = LZ4_compressBound(size);
char* const dst = (char*)malloc(dstCapacity);
char* const rt = (char*)malloc(size);