mirror of
https://github.com/PaddiM8/kalker.git
synced 2025-06-27 05:02:32 +02:00
Add fuzzer
This commit is contained in:
parent
e8a1451694
commit
3a11191fbf
4
kalk/fuzz/.gitignore
vendored
Normal file
4
kalk/fuzz/.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
target
|
||||||
|
corpus
|
||||||
|
artifacts
|
26
kalk/fuzz/Cargo.toml
Normal file
26
kalk/fuzz/Cargo.toml
Normal file
@ -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
|
10
kalk/fuzz/fuzz_targets/parse.rs
Normal file
10
kalk/fuzz/fuzz_targets/parse.rs
Normal file
@ -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);
|
||||||
|
});
|
Loading…
x
Reference in New Issue
Block a user