Add basic fuzzer

This commit is contained in:
Edward Shen 2021-02-24 16:30:14 -05:00
parent f99da79ad9
commit 0bd39a308c
Signed by: edward
GPG key ID: 19182661E818369F
3 changed files with 38 additions and 0 deletions

4
fuzz/.gitignore vendored Normal file
View file

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

26
fuzz/Cargo.toml Normal file
View 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

View 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);
});