From 4cbbb72ce8fb32f0fec5ae45719d48432da6d68e Mon Sep 17 00:00:00 2001 From: Simon Wanner Date: Sat, 9 Apr 2022 22:13:37 +0200 Subject: Meta/Lagom: Add a fuzzer for the WOFF parser --- Meta/Lagom/Fuzzers/CMakeLists.txt | 1 + Meta/Lagom/Fuzzers/FuzzWOFF.cpp | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 Meta/Lagom/Fuzzers/FuzzWOFF.cpp (limited to 'Meta/Lagom') diff --git a/Meta/Lagom/Fuzzers/CMakeLists.txt b/Meta/Lagom/Fuzzers/CMakeLists.txt index cbff945cd4..9c74c24341 100644 --- a/Meta/Lagom/Fuzzers/CMakeLists.txt +++ b/Meta/Lagom/Fuzzers/CMakeLists.txt @@ -64,6 +64,7 @@ add_simple_fuzzer(FuzzUTF16BEDecoder LagomTextCodec) add_simple_fuzzer(FuzzRSAKeyParsing LagomCrypto) add_simple_fuzzer(FuzzWAVLoader LagomAudio) add_simple_fuzzer(FuzzWasmParser LagomWasm) +add_simple_fuzzer(FuzzWOFF LagomGfx) add_simple_fuzzer(FuzzZip LagomArchive) add_simple_fuzzer(FuzzZlibDecompression LagomCompress) diff --git a/Meta/Lagom/Fuzzers/FuzzWOFF.cpp b/Meta/Lagom/Fuzzers/FuzzWOFF.cpp new file mode 100644 index 0000000000..5f2993acdf --- /dev/null +++ b/Meta/Lagom/Fuzzers/FuzzWOFF.cpp @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2022, the SerenityOS developers. + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include +#include + +extern "C" int LLVMFuzzerTestOneInput(u8 const* data, size_t size) +{ + (void)WOFF::Font::try_load_from_externally_owned_memory({ data, size }); + return 0; +} -- cgit v1.2.3