wasmi/fuzz/fuzz_targets/load.rs

14 lines
350 B
Rust
Raw Normal View History

2018-01-24 18:32:46 +00:00
#![no_main]
#[macro_use] extern crate libfuzzer_sys;
extern crate wasmi;
extern crate wabt;
fuzz_target!(|data: &[u8]| {
2018-01-26 13:28:36 +00:00
let wasmi_result = wasmi::load_from_buffer(data);
2018-01-24 18:32:46 +00:00
2018-01-26 08:53:30 +00:00
// TODO: Do validation only! https://github.com/pepyakin/wasmi/issues/16
2018-01-24 18:32:46 +00:00
let wabt_result = wabt::wasm2wat(data);
assert_eq!(wasmi_result.is_ok(), wabt_result.is_ok());
});