Add basic fuzzer
This commit is contained in:
parent
f99da79ad9
commit
0bd39a308c
3 changed files with 38 additions and 0 deletions
4
fuzz/.gitignore
vendored
Normal file
4
fuzz/.gitignore
vendored
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
|
||||||
|
target
|
||||||
|
corpus
|
||||||
|
artifacts
|
26
fuzz/Cargo.toml
Normal file
26
fuzz/Cargo.toml
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
|
||||||
|
[package]
|
||||||
|
name = "git-config-fuzz"
|
||||||
|
version = "0.0.0"
|
||||||
|
authors = ["Automatically generated"]
|
||||||
|
publish = false
|
||||||
|
edition = "2018"
|
||||||
|
|
||||||
|
[package.metadata]
|
||||||
|
cargo-fuzz = true
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
libfuzzer-sys = "0.3"
|
||||||
|
|
||||||
|
[dependencies.git-config]
|
||||||
|
path = ".."
|
||||||
|
|
||||||
|
# Prevent this from interfering with workspaces
|
||||||
|
[workspace]
|
||||||
|
members = ["."]
|
||||||
|
|
||||||
|
[[bin]]
|
||||||
|
name = "parser"
|
||||||
|
path = "fuzz_targets/parser.rs"
|
||||||
|
test = false
|
||||||
|
doc = false
|
8
fuzz/fuzz_targets/parser.rs
Normal file
8
fuzz/fuzz_targets/parser.rs
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
#![no_main]
|
||||||
|
|
||||||
|
use git_config::parser::Parser;
|
||||||
|
use libfuzzer_sys::fuzz_target;
|
||||||
|
|
||||||
|
fuzz_target!(|data: &[u8]| {
|
||||||
|
Parser::from_bytes(data);
|
||||||
|
});
|
Reference in a new issue