diff --git a/kalk/fuzz/.gitignore b/kalk/fuzz/.gitignore new file mode 100644 index 0000000..572e03b --- /dev/null +++ b/kalk/fuzz/.gitignore @@ -0,0 +1,4 @@ + +target +corpus +artifacts diff --git a/kalk/fuzz/Cargo.toml b/kalk/fuzz/Cargo.toml new file mode 100644 index 0000000..184a262 --- /dev/null +++ b/kalk/fuzz/Cargo.toml @@ -0,0 +1,26 @@ + +[package] +name = "kalk-fuzz" +version = "0.0.0" +authors = ["Automatically generated"] +publish = false +edition = "2018" + +[package.metadata] +cargo-fuzz = true + +[dependencies] +libfuzzer-sys = "0.4" + +[dependencies.kalk] +path = ".." + +# Prevent this from interfering with workspaces +[workspace] +members = ["."] + +[[bin]] +name = "parse" +path = "fuzz_targets/parse.rs" +test = false +doc = false diff --git a/kalk/fuzz/fuzz_targets/parse.rs b/kalk/fuzz/fuzz_targets/parse.rs new file mode 100644 index 0000000..b829bff --- /dev/null +++ b/kalk/fuzz/fuzz_targets/parse.rs @@ -0,0 +1,10 @@ +#![no_main] +use libfuzzer_sys::fuzz_target; + +fuzz_target!(|data: &str| { + let mut ctx = kalk::parser::Context::new().set_timeout(Some(5)); + + // We don't care if it parses or not, we only care about if it panicked + // while parsing + let _ = kalk::parser::parse(&mut ctx, data); +});