mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00: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
2 changed files with 21 additions and 0 deletions
|
@ -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 a new issue