Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Commit

Permalink
Add fuzzer for coverage allowlist parse function (#3580)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgreisen authored Oct 18, 2023
1 parent 86a642b commit 90be543
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/agent/coverage/fuzz/Cargo.lock

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

7 changes: 7 additions & 0 deletions src/agent/coverage/fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,10 @@ name = "fuzz_target_record_coverage"
path = "fuzz_targets/fuzz_target_record_coverage.rs"
test = false
doc = false

[[bin]]
name = "fuzz_target_allowlist_parse"
path = "fuzz_targets/fuzz_target_allowlist_parse.rs"
test = false
doc = false

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#![no_main]

use libfuzzer_sys::fuzz_target;
use coverage::allowlist::AllowList;

fuzz_target!(|data: &[u8]| {
// fuzzed code goes here
if let Ok(s) = std::str::from_utf8(data)
{
let _ = AllowList::parse(s);
}
});

0 comments on commit 90be543

Please sign in to comment.