Add cargo-fuzz target

This commit is contained in:
Flakebi
2019-03-29 17:51:08 +01:00
parent 115859668c
commit 34764ca9bf
3 changed files with 32 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 = "simple_asn1-fuzz"
version = "0.0.1"
authors = ["Automatically generated"]
publish = false
[package.metadata]
cargo-fuzz = true
[dependencies.simple_asn1]
path = ".."
[dependencies.libfuzzer-sys]
git = "https://github.com/rust-fuzz/libfuzzer-sys.git"
# Prevent this from interfering with workspaces
[workspace]
members = ["."]
[[bin]]
name = "fuzz_target_1"
path = "fuzz_targets/fuzz_target_1.rs"

View File

@@ -0,0 +1,7 @@
#![no_main]
#[macro_use] extern crate libfuzzer_sys;
extern crate simple_asn1;
fuzz_target!(|data: &[u8]| {
let _ = simple_asn1::from_der(data);
});