summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2023-03-17 12:46:09 -0400
committerLinus Groh <mail@linusgroh.de>2023-03-17 16:48:43 +0000
commit5d7a85bc37ee34b8d840544abeca65c9fdeb6a81 (patch)
tree09644dc348fbdfb2b7ed1c13b8658fc79153baa1
parent6e1b5b541adff55de3cdccf4a5803cc14fd72034 (diff)
downloadserenity-5d7a85bc37ee34b8d840544abeca65c9fdeb6a81.zip
Meta: Ensure the main thread VM is created before use in the CSS fuzzer
-rw-r--r--Meta/Lagom/Fuzzers/FuzzCSSParser.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Meta/Lagom/Fuzzers/FuzzCSSParser.cpp b/Meta/Lagom/Fuzzers/FuzzCSSParser.cpp
index e31f44a5fe..cb8d08ad9f 100644
--- a/Meta/Lagom/Fuzzers/FuzzCSSParser.cpp
+++ b/Meta/Lagom/Fuzzers/FuzzCSSParser.cpp
@@ -17,6 +17,8 @@ Globals::Globals() { Web::Platform::EventLoopPlugin::install(*new Web::Platform:
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
+ MUST(Web::Bindings::initialize_main_thread_vm());
+
// FIXME: There's got to be a better way to do this "correctly"
auto& vm = Web::Bindings::main_thread_vm();
(void)Web::parse_css_stylesheet(Web::CSS::Parser::ParsingContext(*vm.current_realm()), { data, size });