summaryrefslogtreecommitdiffstats
path: root/ossfuzz/decompress_fuzzer.c
diff options
context:
space:
mode:
authorYann Collet <Cyan4973@users.noreply.github.com>2022-08-15 22:45:31 (GMT)
committerGitHub <noreply@github.com>2022-08-15 22:45:31 (GMT)
commit5ff839680134437dbf4678f3d0c7b371d84f4964 (patch)
tree939d919c3903b42ed637542a4799fb3f4fa8b5fc /ossfuzz/decompress_fuzzer.c
parent416bc96faca629abcef42e56ecd2e20d26b79934 (diff)
parentcfd6ab32522280079c2e6d3ea995f172b9ae0312 (diff)
downloadlz4-1.9.4.zip
lz4-1.9.4.tar.gz
lz4-1.9.4.tar.bz2
Merge pull request #1138 from lz4/devv1.9.4release
stage v1.9.4
Diffstat (limited to 'ossfuzz/decompress_fuzzer.c')
-rw-r--r--ossfuzz/decompress_fuzzer.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/ossfuzz/decompress_fuzzer.c b/ossfuzz/decompress_fuzzer.c
index 6f48e30..490b3fd 100644
--- a/ossfuzz/decompress_fuzzer.c
+++ b/ossfuzz/decompress_fuzzer.c
@@ -39,7 +39,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
/* No dictionary. */
LZ4_decompress_safe_usingDict((char const*)data, dst, size,
dstCapacity, NULL, 0);
- /* Small external dictonary. */
+ /* Small external dictionary. */
LZ4_decompress_safe_usingDict((char const*)data, dst, size,
dstCapacity, smallDict, smallDictSize);
/* Large external dictionary. */
@@ -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);