File tree Expand file tree Collapse file tree 3 files changed +37
-1
lines changed Expand file tree Collapse file tree 3 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ edition = "2021"
9
9
cargo-fuzz = true
10
10
11
11
[dependencies ]
12
+ anyhow = " 1.0.77"
12
13
libfuzzer-sys = " 0.4"
13
14
14
15
[dependencies .gix-pathspec ]
Original file line number Diff line number Diff line change
1
+ # ---- Magic signatures ----
2
+ ":(top)"
3
+ "top"
4
+ ":/"
5
+
6
+ ":(icase)"
7
+ "icase"
8
+
9
+ ":(literal)"
10
+ "literal"
11
+
12
+ ":(glob)"
13
+ "glob"
14
+
15
+ # We can't close attr as they take arguments.
16
+ ":(attr:"
17
+ ":(attr:!"
18
+ "attr"
19
+
20
+ ":(exclude)"
21
+ "exclude"
22
+ ":!"
Original file line number Diff line number Diff line change 1
1
#![ no_main]
2
+ use anyhow:: Result ;
2
3
use libfuzzer_sys:: fuzz_target;
4
+ use std:: hint:: black_box;
5
+
6
+ fn fuzz ( data : & [ u8 ] ) -> Result < ( ) > {
7
+ let pattern = gix_pathspec:: parse ( data, Default :: default ( ) ) ?;
8
+ _ = black_box ( pattern. is_nil ( ) ) ;
9
+ _ = black_box ( pattern. prefix_directory ( ) ) ;
10
+ _ = black_box ( pattern. path ( ) ) ;
11
+ // TODO: Fuzz normalize
12
+ _ = black_box ( pattern. is_excluded ( ) ) ;
13
+ _ = black_box ( pattern. to_bstring ( ) ) ;
14
+ Ok ( ( ) )
15
+ }
3
16
4
17
fuzz_target ! ( |data: & [ u8 ] | {
5
- let _a = gix_pathspec :: parse ( data , Default :: default ( ) ) ;
18
+ _ = black_box ( fuzz ( data ) ) ;
6
19
} ) ;
You can’t perform that action at this time.
0 commit comments