mirror of
https://github.com/fluencelabs/wasmer
synced 2024-12-05 02:20:19 +00:00
Initial commit of a fuzzer. Run with "cargo fuzz run simple_instantiate".
Used to discover issue #558. We'll probably want to reconsider the default .gitignore of the artifacts and corpus directories. The fuzzer wastes a lot of time not having even a single exampel of a valid .wasm file to start with.
This commit is contained in:
parent
13abdfee98
commit
5c0ede0b42
4
fuzz/.gitignore
vendored
Normal file
4
fuzz/.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
|
||||
target
|
||||
corpus
|
||||
artifacts
|
21
fuzz/Cargo.toml
Normal file
21
fuzz/Cargo.toml
Normal file
@ -0,0 +1,21 @@
|
||||
|
||||
[package]
|
||||
name = "wasmer-fuzz"
|
||||
version = "0.0.1"
|
||||
authors = ["Automatically generated"]
|
||||
publish = false
|
||||
|
||||
[package.metadata]
|
||||
cargo-fuzz = true
|
||||
|
||||
[dependencies]
|
||||
wasmer-runtime = { path = "../lib/runtime" }
|
||||
libfuzzer-sys = { git = "https://github.com/rust-fuzz/libfuzzer-sys.git" }
|
||||
|
||||
# Prevent this from interfering with workspaces
|
||||
[workspace]
|
||||
members = ["."]
|
||||
|
||||
[[bin]]
|
||||
name = "simple_instantiate"
|
||||
path = "fuzz_targets/simple_instantiate.rs"
|
13
fuzz/fuzz_targets/simple_instantiate.rs
Normal file
13
fuzz/fuzz_targets/simple_instantiate.rs
Normal file
@ -0,0 +1,13 @@
|
||||
#![no_main]
|
||||
#[macro_use] extern crate libfuzzer_sys;
|
||||
extern crate wasmer_runtime;
|
||||
|
||||
use wasmer_runtime::{
|
||||
instantiate,
|
||||
imports,
|
||||
};
|
||||
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
let import_object = imports! {};
|
||||
instantiate(data, &import_object);
|
||||
});
|
Loading…
Reference in New Issue
Block a user