File tree Expand file tree Collapse file tree 4 files changed +37
-4
lines changed Expand file tree Collapse file tree 4 files changed +37
-4
lines changed Original file line number Diff line number Diff line change 99
99
- run : cargo fuzz check
100
100
- run : cargo check --no-default-features --features afl
101
101
working-directory : fuzz
102
-
102
+ - uses : dtolnay/install@honggfuzz
103
+ - run : sudo apt-get install binutils-dev libunwind-dev
104
+ - run : cargo hfuzz build --no-default-features --features honggfuzz
105
+ working-directory : fuzz
103
106
104
107
clippy :
105
108
name : Clippy
Original file line number Diff line number Diff line change 1
1
artifacts /
2
2
corpus /
3
3
coverage /
4
+ hfuzz_target /
5
+ hfuzz_workspace /
4
6
in /
5
7
out /
6
8
target /
Original file line number Diff line number Diff line change @@ -10,12 +10,14 @@ cargo-fuzz = true
10
10
11
11
[dependencies ]
12
12
afl = { version = " 0.12" , optional = true }
13
+ honggfuzz = { version = " 0.5" , optional = true }
13
14
libfuzzer-sys = { version = " 0.4" , optional = true }
14
15
proc-macro2 = { path = " .." , default-features = false }
15
16
16
17
[features ]
17
18
default = [" libfuzzer" ]
18
19
afl = [" dep:afl" ]
20
+ honggfuzz = [" dep:honggfuzz" ]
19
21
libfuzzer = [" dep:libfuzzer-sys" ]
20
22
span-locations = [" proc-macro2/span-locations" ]
21
23
Original file line number Diff line number Diff line change 8
8
// cargo install afl
9
9
// cargo afl build --no-default-features --features afl --release
10
10
// cargo afl fuzz -i in -o out target/release/parse_token_stream
11
+ //
12
+ // honggfuzz:
13
+ //
14
+ // cargo install honggfuzz
15
+ // cargo hfuzz build --no-default-features --features honggfuzz
16
+ // HFUZZ_RUN_ARGS="--threads $(nproc) --max_file_size 200 --timeout 1" cargo hfuzz run parse_token_stream
11
17
12
18
#![ cfg_attr( feature = "libfuzzer" , no_main) ]
13
19
14
20
use std:: str;
15
21
16
22
#[ cfg( not( any(
17
- all( feature = "libfuzzer" , not( feature = "afl" ) ) ,
18
- all( not( feature = "libfuzzer" ) , feature = "afl" ) ,
23
+ all(
24
+ feature = "libfuzzer" ,
25
+ not( feature = "afl" ) ,
26
+ not( feature = "honggfuzz" )
27
+ ) ,
28
+ all(
29
+ not( feature = "libfuzzer" ) ,
30
+ feature = "afl" ,
31
+ not( feature = "honggfuzz" )
32
+ ) ,
33
+ all(
34
+ not( feature = "libfuzzer" ) ,
35
+ not( feature = "afl" ) ,
36
+ feature = "honggfuzz"
37
+ ) ,
19
38
) ) ) ]
20
39
fn main ( ) {
21
40
compile_error ! {
22
- r#"exactly one of feature="libfuzzer" and feature="afl" must be enabled"#
41
+ r#"exactly one of feature="libfuzzer" or feature="afl" or feature="honggfuzz " must be enabled"#
23
42
}
24
43
}
25
44
@@ -32,6 +51,13 @@ fn main() {
32
51
afl:: fuzz ( hook, do_fuzz) ;
33
52
}
34
53
54
+ #[ cfg( feature = "honggfuzz" ) ]
55
+ fn main ( ) {
56
+ loop {
57
+ honggfuzz:: fuzz ( do_fuzz) ;
58
+ }
59
+ }
60
+
35
61
fn do_fuzz ( bytes : & [ u8 ] ) {
36
62
if bytes. len ( ) < 200 {
37
63
if let Ok ( string) = str:: from_utf8 ( bytes) {
You can’t perform that action at this time.
0 commit comments