Add packet parser fuzzer.

v0.7.x
whitequark 2017-06-24 10:10:43 +00:00
parent 8b27330c8b
commit 3eaa96957c
10 changed files with 33 additions and 0 deletions

3
fuzz/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
target
corpus
artifacts

22
fuzz/Cargo.toml Normal file
View File

@ -0,0 +1,22 @@
[package]
name = "smoltcp-fuzz"
version = "0.0.1"
authors = ["Automatically generated"]
publish = false
[package.metadata]
cargo-fuzz = true
[dependencies.smoltcp]
path = ".."
[dependencies.libfuzzer-sys]
git = "https://github.com/rust-fuzz/libfuzzer-sys.git"
# Prevent this from interfering with workspaces
[workspace]
members = ["."]
[[bin]]
name = "packet_parser"
path = "fuzz_targets/packet_parser.rs"

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,8 @@
#![no_main]
#[macro_use] extern crate libfuzzer_sys;
extern crate smoltcp;
fuzz_target!(|data: &[u8]| {
use smoltcp::wire::*;
format!("{}", PrettyPrinter::<EthernetFrame<&'static [u8]>>::new("", &data));
});