mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 17:58:18 +03:00
Lagom/Fuzzers: Add fuzzer for POSIX basic regex parser
This commit is contained in:
parent
2a1bf53435
commit
93340685ed
Notes:
sideshowbarker
2024-07-18 09:09:36 +09:00
Author: https://github.com/Lubrsi Commit: https://github.com/SerenityOS/serenity/commit/93340685ed5 Pull-request: https://github.com/SerenityOS/serenity/pull/8699
@ -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)
|
||||
|
17
Meta/Lagom/Fuzzers/FuzzRegexPosixBasic.cpp
Normal file
17
Meta/Lagom/Fuzzers/FuzzRegexPosixBasic.cpp
Normal file
@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Copyright (c) 2021, Luke Wilde <lukew@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <AK/StringView.h>
|
||||
#include <LibRegex/Regex.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
|
||||
{
|
||||
auto pattern = StringView(static_cast<const unsigned char*>(data), size);
|
||||
[[maybe_unused]] auto re = Regex<PosixBasic>(pattern);
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user