afl: gen -> parse, parse only
This commit is contained in:
parent
648a6dbef2
commit
2606e2f4fc
4 changed files with 12 additions and 16 deletions
2
Makefile
2
Makefile
|
@ -53,7 +53,7 @@ bench:
|
||||||
cov: suite suite_bench
|
cov: suite suite_bench
|
||||||
LLVM_COV=llvm-cov LLVM_PROFDATA=llvm-profdata cargo llvm-cov --features=suite,suite_bench --workspace --html --ignore-run-fail
|
LLVM_COV=llvm-cov LLVM_PROFDATA=llvm-profdata cargo llvm-cov --features=suite,suite_bench --workspace --html --ignore-run-fail
|
||||||
|
|
||||||
AFL_TARGET?=gen
|
AFL_TARGET?=parse
|
||||||
AFL_JOBS?=1
|
AFL_JOBS?=1
|
||||||
AFL_TARGET_CRASH?=crashes
|
AFL_TARGET_CRASH?=crashes
|
||||||
|
|
||||||
|
|
|
@ -8,5 +8,5 @@ afl = "0.11"
|
||||||
jotdown = { path = "../../", features = ["deterministic"] }
|
jotdown = { path = "../../", features = ["deterministic"] }
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "gen"
|
name = "parse"
|
||||||
path = "src/gen.rs"
|
path = "src/parse.rs"
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
use afl::fuzz;
|
|
||||||
|
|
||||||
use jotdown::Render;
|
|
||||||
|
|
||||||
fn main() {
|
|
||||||
fuzz!(|data: &[u8]| {
|
|
||||||
if let Ok(s) = std::str::from_utf8(data) {
|
|
||||||
let p = jotdown::Parser::new(s);
|
|
||||||
let mut output = String::new();
|
|
||||||
jotdown::html::Renderer.push(p, &mut output).unwrap();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
9
tests/afl/src/parse.rs
Normal file
9
tests/afl/src/parse.rs
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
use afl::fuzz;
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
fuzz!(|data: &[u8]| {
|
||||||
|
if let Ok(s) = std::str::from_utf8(data) {
|
||||||
|
jotdown::Parser::new(s).last().unwrap();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
Loading…
Reference in a new issue