From ee2f48350099201694a7586e41d7aa2f09fc74da Mon Sep 17 00:00:00 2001 From: Jia Tan Date: Wed, 6 Dec 2023 18:30:25 +0800 Subject: Tests: Minor cleanups to OSS-Fuzz files. Most of these fixes are small typos and tweaks. A few were caused by bad advice from me. Here is the summary of what is changed: - Author line edits - Small comment changes/additions - Using the return value in the error messages in the fuzz targets' coder initialization code - Removed fuzz_encode_stream.options. This set a max length, which may prevent some worthwhile code paths from being properly exercised. - Removed the max_len option from fuzz_decode_stream.options for the same reason as fuzz_encode_stream. The alone decoder fuzz target still has this restriction. - Altered the dictionary contents for fuzz_lzma.dict. Instead of keeping the properties static and varying the dictionary size, the properties are varied and the dictionary size is kept small. The dictionary size doesn't have much impact on the code paths but the properties do. Closes: https://github.com/tukaani-project/xz/pull/73 --- tests/ossfuzz/config/fuzz_decode_stream.options | 1 - tests/ossfuzz/config/fuzz_lzma.dict | 34 ++++++++++++------------- 2 files changed, 16 insertions(+), 19 deletions(-) (limited to 'tests/ossfuzz/config') diff --git a/tests/ossfuzz/config/fuzz_decode_stream.options b/tests/ossfuzz/config/fuzz_decode_stream.options index 61799737..d8f9edba 100644 --- a/tests/ossfuzz/config/fuzz_decode_stream.options +++ b/tests/ossfuzz/config/fuzz_decode_stream.options @@ -1,3 +1,2 @@ [libfuzzer] -max_len = 4096 dict = fuzz_xz.dict diff --git a/tests/ossfuzz/config/fuzz_lzma.dict b/tests/ossfuzz/config/fuzz_lzma.dict index 38d4da3e..82a2b871 100644 --- a/tests/ossfuzz/config/fuzz_lzma.dict +++ b/tests/ossfuzz/config/fuzz_lzma.dict @@ -1,22 +1,20 @@ # first 5 header bytes of .lzma archives based on the info from -# https://github.com/tukaani-project/xz/blob/master/doc/lzma-file-format.txt +# /doc/lzma-file-format.txt -# byte 0 value (properties=0x5d) is created by encoding -# common values (lc=3, lp=0, pb=2) using the algorithm, -# described in the documentation above +# byte 0 is created by encoding LZMA property values (lc, lp, pb) +# using the algorithm described in the documentation above. - -# compression preset 1 (dictionary size = 0x00100000) +# lc=3, lp=0, pb=2 and dictionary size = 0x00100000 "\x5d\x00\x00\x10\x00" -# compression preset 2 (dictionary size = 0x00200000) -"\x5d\x00\x00\x20\x00" -# compression preset 3, 4 (dictionary size = 0x00400000) -"\x5d\x00\x00\x40\x00" -# compression preset 5, 6 (dictionary size = 0x00800000) -"\x5d\x00\x00\x80\x00" -# compression preset 7 (dictionary size = 0x01000000) -"\x5d\x00\x00\x00\x01" -# compression preset 8 (dictionary size = 0x02000000) -"\x5d\x00\x00\x00\x02" -# compression preset 9 (dictionary size = 0x04000000) -"\x5d\x00\x00\x00\x04" + +# lc=3, lp=1, pb=3 and dictionary size = 0x00100000 +"\x93\x00\x00\x10\x00" + +# lc=2, lp=2, pb=4 and dictionary size = 0x00100000 +"\xc8\x00\x00\x10\x00" + +# lc=1, lp=3, pb=1 and dictionary size = 0x00200000 +"\x49\x00\x00\x20\x00" + +# lc=0, lp=4, pb=0 and dictionary size = 0x00200000 +"\x24\x00\x00\x20\x00" -- cgit v1.2.3