summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Meta/Lagom/Fuzzers/CMakeLists.txt1
-rw-r--r--Meta/Lagom/Fuzzers/FuzzPEM.cpp15
2 files changed, 16 insertions, 0 deletions
diff --git a/Meta/Lagom/Fuzzers/CMakeLists.txt b/Meta/Lagom/Fuzzers/CMakeLists.txt
index d84f741529..ffd286a893 100644
--- a/Meta/Lagom/Fuzzers/CMakeLists.txt
+++ b/Meta/Lagom/Fuzzers/CMakeLists.txt
@@ -28,6 +28,7 @@ add_simple_fuzzer(FuzzGzipDecompression LagomCompress)
add_simple_fuzzer(FuzzICOLoader LagomGfx)
add_simple_fuzzer(FuzzJPGLoader LagomGfx)
add_simple_fuzzer(FuzzMD5 LagomCrypto)
+add_simple_fuzzer(FuzzPEM LagomCrypto)
add_simple_fuzzer(FuzzPNGLoader LagomGfx)
add_simple_fuzzer(FuzzPBMLoader LagomGfx)
add_simple_fuzzer(FuzzPGMLoader LagomGfx)
diff --git a/Meta/Lagom/Fuzzers/FuzzPEM.cpp b/Meta/Lagom/Fuzzers/FuzzPEM.cpp
new file mode 100644
index 0000000000..cf950ebda0
--- /dev/null
+++ b/Meta/Lagom/Fuzzers/FuzzPEM.cpp
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2021, Brian Gianforcaro <bgianf@serenityos.org>
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#include <LibCrypto/ASN1/PEM.h>
+#include <stddef.h>
+#include <stdint.h>
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
+{
+ (void)Crypto::decode_pem({ data, size });
+ return 0;
+}