Skip to content

Commit

Permalink
Merge pull request #2 from evanrichter/cargo-fuzz
Browse files Browse the repository at this point in the history
cargo fuzz harness
  • Loading branch information
sejoker authored Aug 1, 2022
2 parents e3f0478 + ce69405 commit 3c90bf4
Show file tree
Hide file tree
Showing 6 changed files with 176 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fuzz/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
target
corpus
artifacts
coverage
137 changes: 137 additions & 0 deletions fuzz/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions fuzz/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[package]
name = "svg-hush-fuzz"
version = "0.0.0"
publish = false
edition = "2021"

[package.metadata]
cargo-fuzz = true

[dependencies]
libfuzzer-sys = "0.4"

[dependencies.svg-hush]
path = ".."

# Prevent this from interfering with workspaces
[workspace]
members = ["."]

[profile.release]
debug = 1

[[bin]]
name = "filter"
path = "fuzz_targets/filter.rs"
test = false
doc = false
1 change: 1 addition & 0 deletions fuzz/corpus/filter/filtered.xml
1 change: 1 addition & 0 deletions fuzz/corpus/filter/test.xml
6 changes: 6 additions & 0 deletions fuzz/fuzz_targets/filter.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#![no_main]
use libfuzzer_sys::fuzz_target;

fuzz_target!(|data: &[u8]| {
let _ = svg_hush::Filter::new().filter(data, std::io::sink());
});

0 comments on commit 3c90bf4

Please sign in to comment.