summaryrefslogtreecommitdiff
path: root/Meta/Lagom/Fuzzers/FuzzSQLParser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Meta/Lagom/Fuzzers/FuzzSQLParser.cpp')
-rw-r--r--Meta/Lagom/Fuzzers/FuzzSQLParser.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/Meta/Lagom/Fuzzers/FuzzSQLParser.cpp b/Meta/Lagom/Fuzzers/FuzzSQLParser.cpp
new file mode 100644
index 0000000000..0532e83274
--- /dev/null
+++ b/Meta/Lagom/Fuzzers/FuzzSQLParser.cpp
@@ -0,0 +1,16 @@
+/*
+ * Copyright (c) 2021, Luke Wilde <lukew@serenityos.org>
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#include <LibSQL/Lexer.h>
+#include <LibSQL/Parser.h>
+#include <stdio.h>
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
+{
+ auto parser = SQL::Parser(SQL::Lexer({ data, size }));
+ [[maybe_unused]] auto statement = parser.next_statement();
+ return 0;
+}