[Fuzz] Improve data generation #1723

Converting the rest of the tests to use the new data producer.
This commit is contained in:
Dario Pavlovic
2019-09-10 16:14:43 -07:00
parent ea1ad123da
commit 0630d084cb
13 changed files with 159 additions and 117 deletions
+1 -2
View File
@@ -25,7 +25,6 @@ int LLVMFuzzerTestOneInput(const uint8_t *src, size_t size)
{
FUZZ_dataProducer_t *producer = FUZZ_dataProducer_create(src, size);
int i;
if (!dctx) {
dctx = ZSTD_createDCtx();
FUZZ_ASSERT(dctx);
@@ -37,7 +36,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *src, size_t size)
/* Restrict to remaining data. If we run out of data while generating params,
we should still continue and let decompression happen on empty data. */
size = FUZZ_dataProducer_remainingBytes(producer);
size = FUZZ_dataProducer_remainingBytes(producer);
ZSTD_decompressDCtx(dctx, rBuf, bufSize, src, size);
free(rBuf);