mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-28 21:54:40 +03: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 ✅
@ -10,6 +10,12 @@
|
||||
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
|
||||
{
|
||||
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;
|
||||
}
|
@ -11,8 +11,8 @@ set(FUZZER_TARGETS
|
||||
FlacLoader
|
||||
Gemini
|
||||
GIFLoader
|
||||
GzipCompression
|
||||
GzipDecompression
|
||||
GzipRoundtrip
|
||||
HttpRequest
|
||||
ICCProfile
|
||||
ICOLoader
|
||||
@ -83,8 +83,8 @@ set(FUZZER_DEPENDENCIES_ELF LibELF)
|
||||
set(FUZZER_DEPENDENCIES_FlacLoader LibAudio)
|
||||
set(FUZZER_DEPENDENCIES_Gemini LibGemini)
|
||||
set(FUZZER_DEPENDENCIES_GIFLoader LibGfx)
|
||||
set(FUZZER_DEPENDENCIES_GzipCompression LibCompress)
|
||||
set(FUZZER_DEPENDENCIES_GzipDecompression LibCompress)
|
||||
set(FUZZER_DEPENDENCIES_GzipRoundtrip LibCompress)
|
||||
set(FUZZER_DEPENDENCIES_HttpRequest LibHTTP)
|
||||
set(FUZZER_DEPENDENCIES_ICCProfile LibGfx)
|
||||
set(FUZZER_DEPENDENCIES_ICOLoader LibGfx)
|
||||
|
@ -25,8 +25,8 @@
|
||||
T(FlacLoader) \
|
||||
T(Gemini) \
|
||||
T(GIFLoader) \
|
||||
T(GzipCompression) \
|
||||
T(GzipDecompression) \
|
||||
T(GzipRoundtrip) \
|
||||
T(HttpRequest) \
|
||||
T(ICCProfile) \
|
||||
T(ICOLoader) \
|
||||
|
Loading…
Reference in New Issue
Block a user