Add plain load to fuzzer (#58)
This commit is contained in:
parent
d11dffcf51
commit
d02b0f8527
|
@ -24,6 +24,10 @@ members = ["."]
|
|||
name = "load"
|
||||
path = "fuzz_targets/load.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "load_wabt"
|
||||
path = "fuzz_targets/load_wabt.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "load_wasmparser"
|
||||
path = "fuzz_targets/load_wasmparser.rs"
|
||||
|
|
|
@ -1,13 +1,9 @@
|
|||
#![no_main]
|
||||
#[macro_use]
|
||||
extern crate libfuzzer_sys;
|
||||
extern crate wabt;
|
||||
extern crate wasmi;
|
||||
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
let wasmi_result = wasmi::Module::from_buffer(data);
|
||||
let wabt_result =
|
||||
wabt::Module::read_binary(data, &Default::default()).and_then(|m| m.validate());
|
||||
|
||||
assert_eq!(wasmi_result.is_ok(), wabt_result.is_ok());
|
||||
// Just check if loading some arbitrary buffer doesn't panic.
|
||||
let _ = wasmi::Module::from_buffer(data);
|
||||
});
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
#![no_main]
|
||||
#[macro_use]
|
||||
extern crate libfuzzer_sys;
|
||||
extern crate wabt;
|
||||
extern crate wasmi;
|
||||
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
let wasmi_result = wasmi::Module::from_buffer(data);
|
||||
let wabt_result =
|
||||
wabt::Module::read_binary(data, &Default::default()).and_then(|m| m.validate());
|
||||
|
||||
assert_eq!(wasmi_result.is_ok(), wabt_result.is_ok());
|
||||
});
|
Loading…
Reference in New Issue