mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 13:36:13 +03:00
Meta: Add a Wasm parser fuzzer
This commit is contained in:
parent
90e5f607bd
commit
ba2fce14d3
Notes:
sideshowbarker
2024-07-18 17:40:03 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/ba2fce14d31 Pull-request: https://github.com/SerenityOS/serenity/pull/7239 Reviewed-by: https://github.com/linusg
@ -44,6 +44,7 @@ add_simple_fuzzer(FuzzURL)
|
||||
add_simple_fuzzer(FuzzUTF16BEDecoder)
|
||||
add_simple_fuzzer(FuzzRSAKeyParsing)
|
||||
add_simple_fuzzer(FuzzWAVLoader)
|
||||
add_simple_fuzzer(FuzzWasmParser)
|
||||
add_simple_fuzzer(FuzzZip)
|
||||
add_simple_fuzzer(FuzzZlibDecompression)
|
||||
|
||||
|
20
Meta/Lagom/Fuzzers/FuzzWasmParser.cpp
Normal file
20
Meta/Lagom/Fuzzers/FuzzWasmParser.cpp
Normal file
@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright (c) 2021, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <AK/MemoryStream.h>
|
||||
#include <AK/Stream.h>
|
||||
#include <LibWasm/Types.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
|
||||
{
|
||||
ReadonlyBytes bytes { data, size };
|
||||
InputMemoryStream stream { bytes };
|
||||
[[maybe_unused]] auto result = Wasm::Module::parse(stream);
|
||||
stream.handle_any_error();
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user