From 93340685ed54d38a7aca8001b4bcf43580291e91 Mon Sep 17 00:00:00 2001 From: Luke Date: Mon, 12 Jul 2021 21:48:27 +0100 Subject: Lagom/Fuzzers: Add fuzzer for POSIX basic regex parser --- Meta/Lagom/Fuzzers/CMakeLists.txt | 1 + Meta/Lagom/Fuzzers/FuzzRegexPosixBasic.cpp | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 Meta/Lagom/Fuzzers/FuzzRegexPosixBasic.cpp (limited to 'Meta/Lagom/Fuzzers') diff --git a/Meta/Lagom/Fuzzers/CMakeLists.txt b/Meta/Lagom/Fuzzers/CMakeLists.txt index 0b766e322c..ad7034b994 100644 --- a/Meta/Lagom/Fuzzers/CMakeLists.txt +++ b/Meta/Lagom/Fuzzers/CMakeLists.txt @@ -39,6 +39,7 @@ add_simple_fuzzer(FuzzLatin1Decoder) add_simple_fuzzer(FuzzLatin2Decoder) add_simple_fuzzer(FuzzMarkdown) add_simple_fuzzer(FuzzRegexECMA262) +add_simple_fuzzer(FuzzRegexPosixBasic) add_simple_fuzzer(FuzzRegexPosixExtended) add_simple_fuzzer(FuzzSHA1) add_simple_fuzzer(FuzzSHA256) diff --git a/Meta/Lagom/Fuzzers/FuzzRegexPosixBasic.cpp b/Meta/Lagom/Fuzzers/FuzzRegexPosixBasic.cpp new file mode 100644 index 0000000000..f66da056b6 --- /dev/null +++ b/Meta/Lagom/Fuzzers/FuzzRegexPosixBasic.cpp @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2021, Luke Wilde + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include +#include +#include +#include + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) +{ + auto pattern = StringView(static_cast(data), size); + [[maybe_unused]] auto re = Regex(pattern); + return 0; +} -- cgit v1.2.3