mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 09:37:34 +00:00
Meta: Add a Wasm parser fuzzer
This commit is contained in:
parent
90e5f607bd
commit
ba2fce14d3
2 changed files with 21 additions and 0 deletions
|
@ -44,6 +44,7 @@ add_simple_fuzzer(FuzzURL)
|
||||||
add_simple_fuzzer(FuzzUTF16BEDecoder)
|
add_simple_fuzzer(FuzzUTF16BEDecoder)
|
||||||
add_simple_fuzzer(FuzzRSAKeyParsing)
|
add_simple_fuzzer(FuzzRSAKeyParsing)
|
||||||
add_simple_fuzzer(FuzzWAVLoader)
|
add_simple_fuzzer(FuzzWAVLoader)
|
||||||
|
add_simple_fuzzer(FuzzWasmParser)
|
||||||
add_simple_fuzzer(FuzzZip)
|
add_simple_fuzzer(FuzzZip)
|
||||||
add_simple_fuzzer(FuzzZlibDecompression)
|
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…
Add table
Add a link
Reference in a new issue