-
-
Notifications
You must be signed in to change notification settings - Fork 329
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Fuzz more of the API - Add associated dictionary
- Loading branch information
1 parent
34e4a16
commit 6ac89e5
Showing
3 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# ---- Magic signatures ---- | ||
":(top)" | ||
"top" | ||
":/" | ||
|
||
":(icase)" | ||
"icase" | ||
|
||
":(literal)" | ||
"literal" | ||
|
||
":(glob)" | ||
"glob" | ||
|
||
# We can't close attr as they take arguments. | ||
":(attr:" | ||
":(attr:!" | ||
"attr" | ||
|
||
":(exclude)" | ||
"exclude" | ||
":!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,19 @@ | ||
#![no_main] | ||
use anyhow::Result; | ||
use libfuzzer_sys::fuzz_target; | ||
use std::hint::black_box; | ||
|
||
fn fuzz(data: &[u8]) -> Result<()> { | ||
let pattern = gix_pathspec::parse(data, Default::default())?; | ||
_ = black_box(pattern.is_nil()); | ||
_ = black_box(pattern.prefix_directory()); | ||
_ = black_box(pattern.path()); | ||
// TODO: Fuzz normalize | ||
_ = black_box(pattern.is_excluded()); | ||
_ = black_box(pattern.to_bstring()); | ||
Ok(()) | ||
} | ||
|
||
fuzz_target!(|data: &[u8]| { | ||
let _a = gix_pathspec::parse(data, Default::default()); | ||
_ = black_box(fuzz(data)); | ||
}); |