diff options
author | Ali Mohammad Pur <ali.mpfard@gmail.com> | 2023-02-12 17:54:30 +0330 |
---|---|---|
committer | Ali Mohammad Pur <Ali.mpfard@gmail.com> | 2023-02-13 23:00:15 +0330 |
commit | 617d11278016831bc8f2256a226fca5b5e94dc9c (patch) | |
tree | 3af16c57c4fa57eb99f713eefeb07622484f0661 /Meta | |
parent | eb20fbe145d2100df790e4ef0e2ed4402b97bfea (diff) | |
download | serenity-617d11278016831bc8f2256a226fca5b5e94dc9c.zip |
Meta: Add a `Shell --posix` parser fuzzer
Diffstat (limited to 'Meta')
-rw-r--r-- | Meta/Lagom/Fuzzers/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Meta/Lagom/Fuzzers/FuzzShellPosix.cpp | 19 |
2 files changed, 20 insertions, 0 deletions
diff --git a/Meta/Lagom/Fuzzers/CMakeLists.txt b/Meta/Lagom/Fuzzers/CMakeLists.txt index 0b6eb0f883..c3c7fc5205 100644 --- a/Meta/Lagom/Fuzzers/CMakeLists.txt +++ b/Meta/Lagom/Fuzzers/CMakeLists.txt @@ -62,6 +62,7 @@ add_simple_fuzzer(FuzzSHA256 LibCrypto) add_simple_fuzzer(FuzzSHA384 LibCrypto) add_simple_fuzzer(FuzzSHA512 LibCrypto) add_simple_fuzzer(FuzzShell LibShell) +add_simple_fuzzer(FuzzShellPosix LibShell) add_simple_fuzzer(FuzzSQLParser LibSQL) add_simple_fuzzer(FuzzTar LibArchive) add_simple_fuzzer(FuzzTTF LibGfx) diff --git a/Meta/Lagom/Fuzzers/FuzzShellPosix.cpp b/Meta/Lagom/Fuzzers/FuzzShellPosix.cpp new file mode 100644 index 0000000000..e1254720a2 --- /dev/null +++ b/Meta/Lagom/Fuzzers/FuzzShellPosix.cpp @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2020-2023, the SerenityOS developers. + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include <AK/StringView.h> +#include <Shell/PosixParser.h> +#include <Shell/Shell.h> +#include <stddef.h> +#include <stdint.h> + +extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size) +{ + auto source = StringView(static_cast<unsigned char const*>(data), size); + Shell::Posix::Parser parser(source); + (void)parser.parse(); + return 0; +} |