diff options
author | Qi Wang <wangqi@linux.alibaba.com> | 2022-06-06 04:16:17 (GMT) |
---|---|---|
committer | Qi Wang <wangqi@linux.alibaba.com> | 2022-06-07 09:13:01 (GMT) |
commit | 582f5fe534675da1cff232b77970208b6fc240f8 (patch) | |
tree | 27a9f6692067f317d0353a3b34b90e8132c14b24 /ossfuzz/decompress_fuzzer.c | |
parent | ec75db22941d833ef542b43c52c75d143aeba48a (diff) | |
download | lz4-582f5fe534675da1cff232b77970208b6fc240f8.zip lz4-582f5fe534675da1cff232b77970208b6fc240f8.tar.gz lz4-582f5fe534675da1cff232b77970208b6fc240f8.tar.bz2 |
ossfuzz: add fuzz for `LZ4_decompress_safe_partial_usingDict`
Signed-off-by: Qi Wang <wangqi@linux.alibaba.com>
Diffstat (limited to 'ossfuzz/decompress_fuzzer.c')
-rw-r--r-- | ossfuzz/decompress_fuzzer.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/ossfuzz/decompress_fuzzer.c b/ossfuzz/decompress_fuzzer.c index a9a197c..490b3fd 100644 --- a/ossfuzz/decompress_fuzzer.c +++ b/ossfuzz/decompress_fuzzer.c @@ -49,11 +49,27 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) LZ4_decompress_safe_usingDict((char const*)dataAfterDict, dst, size, dstCapacity, smallDict, smallDictSize); /* Large prefix. */ - LZ4_decompress_safe_usingDict((char const*)data, dst, size, + LZ4_decompress_safe_usingDict((char const*)dataAfterDict, dst, size, dstCapacity, largeDict, largeDictSize); /* Partial decompression. */ LZ4_decompress_safe_partial((char const*)data, dst, size, dstCapacity, dstCapacity); + /* Partial decompression using each possible dictionary configuration. */ + /* Partial decompression with no dictionary. */ + LZ4_decompress_safe_partial_usingDict((char const*)data, dst, size, + dstCapacity, dstCapacity, NULL, 0); + /* Partial decompression with small external dictionary. */ + LZ4_decompress_safe_partial_usingDict((char const*)data, dst, size, + dstCapacity, dstCapacity, smallDict, smallDictSize); + /* Partial decompression with large external dictionary. */ + LZ4_decompress_safe_partial_usingDict((char const*)data, dst, size, + dstCapacity, dstCapacity, largeDict, largeDictSize); + /* Partial decompression with small prefix. */ + LZ4_decompress_safe_partial_usingDict((char const*)dataAfterDict, dst, size, + dstCapacity, dstCapacity, smallDict, smallDictSize); + /* Partial decompression wtih large prefix. */ + LZ4_decompress_safe_partial_usingDict((char const*)dataAfterDict, dst, size, + dstCapacity, dstCapacity, largeDict, largeDictSize); free(dst); free(dict); FUZZ_dataProducer_free(producer); |