2020-11-28 14:48:01 -03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2020, the SerenityOS developers.
|
|
|
|
|
*
|
2021-04-22 05:24:48 -03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-11-28 14:48:01 -03:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <AK/StringView.h>
|
2026-06-22 08:07:20 -03:00
|
|
|
#include <AK/Utf16String.h>
|
2026-03-25 06:52:59 -03:00
|
|
|
#include <LibRegex/ECMAScriptRegex.h>
|
2020-11-28 14:48:01 -03:00
|
|
|
#include <stddef.h>
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
2022-04-01 14:58:27 -03:00
|
|
|
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
|
2020-11-28 14:48:01 -03:00
|
|
|
{
|
2023-11-03 14:49:54 -03:00
|
|
|
AK::set_debug_enabled(false);
|
2026-06-22 08:07:20 -03:00
|
|
|
auto pattern = Utf16String::from_utf8_with_replacement_character(StringView(static_cast<unsigned char const*>(data), size));
|
|
|
|
|
[[maybe_unused]] auto re = regex::ECMAScriptRegex::compile(pattern.utf16_view(), {});
|
2020-11-28 14:48:01 -03:00
|
|
|
return 0;
|
|
|
|
|
}
|