summaryrefslogtreecommitdiff
path: root/Meta/Lagom
diff options
context:
space:
mode:
authorSimon Wanner <skyrising@pvpctutorials.de>2022-04-09 22:13:37 +0200
committerAndreas Kling <kling@serenityos.org>2022-04-09 23:48:18 +0200
commit4cbbb72ce8fb32f0fec5ae45719d48432da6d68e (patch)
tree491ac5a6ae9af9d75be1abf587fa9dd4618147be /Meta/Lagom
parentb19e1349998d55968dfd09cc745ed7692e11ed74 (diff)
downloadserenity-4cbbb72ce8fb32f0fec5ae45719d48432da6d68e.zip
Meta/Lagom: Add a fuzzer for the WOFF parser
Diffstat (limited to 'Meta/Lagom')
-rw-r--r--Meta/Lagom/Fuzzers/CMakeLists.txt1
-rw-r--r--Meta/Lagom/Fuzzers/FuzzWOFF.cpp14
2 files changed, 15 insertions, 0 deletions
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 <LibGfx/Font/WOFF/Font.h>
+#include <stddef.h>
+
+extern "C" int LLVMFuzzerTestOneInput(u8 const* data, size_t size)
+{
+ (void)WOFF::Font::try_load_from_externally_owned_memory({ data, size });
+ return 0;
+}