mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 00:50:22 +00:00
LibCompress: Upgrade compression fuzzer into a roundtrip fuzzer
This commit is contained in:
parent
70ac6918d1
commit
0465ba242b
Notes:
sideshowbarker
2024-07-17 04:34:25 +09:00
Author: https://github.com/Janiczek Commit: https://github.com/SerenityOS/serenity/commit/0465ba242b Pull-request: https://github.com/SerenityOS/serenity/pull/21618 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/timschumi ✅
3 changed files with 10 additions and 4 deletions
|
@ -10,6 +10,12 @@
|
||||||
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
|
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
|
||||||
{
|
{
|
||||||
AK::set_debug_enabled(false);
|
AK::set_debug_enabled(false);
|
||||||
(void)Compress::GzipCompressor::compress_all(ReadonlyBytes { data, size });
|
auto input = ReadonlyBytes { data, size };
|
||||||
|
|
||||||
|
auto compressed = MUST(Compress::GzipCompressor::compress_all(input));
|
||||||
|
auto decompressed = MUST(Compress::GzipDecompressor::decompress_all(compressed));
|
||||||
|
|
||||||
|
VERIFY(decompressed == input);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
|
@ -11,8 +11,8 @@ set(FUZZER_TARGETS
|
||||||
FlacLoader
|
FlacLoader
|
||||||
Gemini
|
Gemini
|
||||||
GIFLoader
|
GIFLoader
|
||||||
GzipCompression
|
|
||||||
GzipDecompression
|
GzipDecompression
|
||||||
|
GzipRoundtrip
|
||||||
HttpRequest
|
HttpRequest
|
||||||
ICCProfile
|
ICCProfile
|
||||||
ICOLoader
|
ICOLoader
|
||||||
|
@ -83,8 +83,8 @@ set(FUZZER_DEPENDENCIES_ELF LibELF)
|
||||||
set(FUZZER_DEPENDENCIES_FlacLoader LibAudio)
|
set(FUZZER_DEPENDENCIES_FlacLoader LibAudio)
|
||||||
set(FUZZER_DEPENDENCIES_Gemini LibGemini)
|
set(FUZZER_DEPENDENCIES_Gemini LibGemini)
|
||||||
set(FUZZER_DEPENDENCIES_GIFLoader LibGfx)
|
set(FUZZER_DEPENDENCIES_GIFLoader LibGfx)
|
||||||
set(FUZZER_DEPENDENCIES_GzipCompression LibCompress)
|
|
||||||
set(FUZZER_DEPENDENCIES_GzipDecompression LibCompress)
|
set(FUZZER_DEPENDENCIES_GzipDecompression LibCompress)
|
||||||
|
set(FUZZER_DEPENDENCIES_GzipRoundtrip LibCompress)
|
||||||
set(FUZZER_DEPENDENCIES_HttpRequest LibHTTP)
|
set(FUZZER_DEPENDENCIES_HttpRequest LibHTTP)
|
||||||
set(FUZZER_DEPENDENCIES_ICCProfile LibGfx)
|
set(FUZZER_DEPENDENCIES_ICCProfile LibGfx)
|
||||||
set(FUZZER_DEPENDENCIES_ICOLoader LibGfx)
|
set(FUZZER_DEPENDENCIES_ICOLoader LibGfx)
|
||||||
|
|
|
@ -25,8 +25,8 @@
|
||||||
T(FlacLoader) \
|
T(FlacLoader) \
|
||||||
T(Gemini) \
|
T(Gemini) \
|
||||||
T(GIFLoader) \
|
T(GIFLoader) \
|
||||||
T(GzipCompression) \
|
|
||||||
T(GzipDecompression) \
|
T(GzipDecompression) \
|
||||||
|
T(GzipRoundtrip) \
|
||||||
T(HttpRequest) \
|
T(HttpRequest) \
|
||||||
T(ICCProfile) \
|
T(ICCProfile) \
|
||||||
T(ICOLoader) \
|
T(ICOLoader) \
|
||||||
|
|
Loading…
Reference in a new issue