File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-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.76"
12
13
libfuzzer-sys = " 0.4"
13
14
14
15
[dependencies .gix-url ]
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
+ use std:: path:: Path ;
6
+
7
+ fn fuzz ( data : & [ u8 ] ) -> Result < ( ) > {
8
+ let url = gix_url:: parse ( data. into ( ) ) ?;
9
+ _ = black_box ( url. user ( ) ) ;
10
+ _ = black_box ( url. password ( ) ) ;
11
+ _ = black_box ( url. password ( ) ) ;
12
+ _ = black_box ( url. host_argument_safe ( ) ) ;
13
+ _ = black_box ( url. path_argument_safe ( ) ) ;
14
+ _ = black_box ( url. path_is_root ( ) ) ;
15
+ _ = black_box ( url. port_or_default ( ) ) ;
16
+ _ = black_box ( url. canonicalized ( Path :: new ( "/cwd" ) ) ) ;
17
+ _ = black_box ( url. to_bstring ( ) ) ;
18
+
19
+ _ = black_box ( gix_url:: expand_path:: parse ( data. into ( ) ) ) ;
20
+ Ok ( ( ) )
21
+ }
3
22
4
23
fuzz_target ! ( |data: & [ u8 ] | {
5
- let _a = gix_url :: parse ( data . into ( ) ) ;
24
+ _ = black_box ( fuzz ( data ) ) ;
6
25
} ) ;
You can’t perform that action at this time.
0 commit comments