Add cargo-fuzz target
This commit is contained in:
3
fuzz/.gitignore
vendored
Normal file
3
fuzz/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
target
|
||||
corpus
|
||||
artifacts
|
||||
22
fuzz/Cargo.toml
Normal file
22
fuzz/Cargo.toml
Normal 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"
|
||||
7
fuzz/fuzz_targets/fuzz_target_1.rs
Normal file
7
fuzz/fuzz_targets/fuzz_target_1.rs
Normal 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);
|
||||
});
|
||||
Reference in New Issue
Block a user