/src/serenity/Meta/Lagom/Fuzzers/FuzzShellPosix.cpp
Line | Count | Source |
1 | | /* |
2 | | * Copyright (c) 2020-2023, the SerenityOS developers. |
3 | | * |
4 | | * SPDX-License-Identifier: BSD-2-Clause |
5 | | */ |
6 | | |
7 | | #include <AK/StringView.h> |
8 | | #include <LibShell/PosixParser.h> |
9 | | #include <LibShell/Shell.h> |
10 | | #include <stddef.h> |
11 | | #include <stdint.h> |
12 | | |
13 | | extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size) |
14 | 95.6k | { |
15 | 95.6k | AK::set_debug_enabled(false); |
16 | 95.6k | auto source = StringView(static_cast<unsigned char const*>(data), size); |
17 | 95.6k | Shell::Posix::Parser parser(source); |
18 | 95.6k | (void)parser.parse(); |
19 | 95.6k | return 0; |
20 | 95.6k | } |