summaryrefslogtreecommitdiff
path: root/Meta/Lagom/Fuzzers/FuzzIMAPParser.cpp
diff options
context:
space:
mode:
authorx-yl <kylepereira@mail.com>2021-06-01 17:28:08 +0400
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2021-06-11 23:58:28 +0430
commitac712b07f9cfc5494bd259976addebabedc091d2 (patch)
tree2dea03aef3def712b96afc17fe9a9c8509185764 /Meta/Lagom/Fuzzers/FuzzIMAPParser.cpp
parent8c6061fc4af79984e2c9fbbb2300567a9f5ebbfe (diff)
downloadserenity-ac712b07f9cfc5494bd259976addebabedc091d2.zip
Meta: Fuzz the LibIMAP Parser
Diffstat (limited to 'Meta/Lagom/Fuzzers/FuzzIMAPParser.cpp')
-rw-r--r--Meta/Lagom/Fuzzers/FuzzIMAPParser.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/Meta/Lagom/Fuzzers/FuzzIMAPParser.cpp b/Meta/Lagom/Fuzzers/FuzzIMAPParser.cpp
new file mode 100644
index 0000000000..045adc9270
--- /dev/null
+++ b/Meta/Lagom/Fuzzers/FuzzIMAPParser.cpp
@@ -0,0 +1,17 @@
+/*
+ * Copyright (c) 2021, Kyle Pereira <hey@xylepereira.me>
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#include <LibIMAP/Parser.h>
+#include <stddef.h>
+#include <stdint.h>
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
+{
+ auto parser = IMAP::Parser();
+ parser.parse(ByteBuffer::copy(data, size), true);
+ parser.parse(ByteBuffer::copy(data, size), false);
+ return 0;
+}