File tree Expand file tree Collapse file tree 5 files changed +29
-3
lines changed Expand file tree Collapse file tree 5 files changed +29
-3
lines changed Original file line number Diff line number Diff line change @@ -8,3 +8,5 @@ unicode-data.txt
8
8
fuzz /target
9
9
fuzz /corpus
10
10
fuzz /artifacts
11
+ fuzz /hfuzz_target
12
+ fuzz /hfuzz_workspace
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ cargo-fuzz = true
10
10
11
11
[dependencies ]
12
12
libfuzzer-sys = " 0.4"
13
+ honggfuzz = " 0.5"
13
14
14
15
[dependencies .markdown ]
15
16
path = " .."
@@ -19,7 +20,13 @@ path = ".."
19
20
members = [" ." ]
20
21
21
22
[[bin ]]
22
- name = " markdown "
23
- path = " fuzz_targets/markdown .rs"
23
+ name = " markdown_libfuzz "
24
+ path = " fuzz_targets/markdown_libfuzz .rs"
24
25
test = false
25
26
doc = false
27
+
28
+ [[bin ]]
29
+ name = " markdown_honggfuzz"
30
+ path = " fuzz_targets/markdown_honggfuzz.rs"
31
+ test = false
32
+ doc = false
Original file line number Diff line number Diff line change
1
+ use honggfuzz:: fuzz;
2
+
3
+ fn main ( ) {
4
+ loop {
5
+ fuzz ! ( |data: & [ u8 ] | {
6
+ if let Ok ( s) = std:: str :: from_utf8( data) {
7
+ let _ = markdown:: to_html( s) ;
8
+ let _ = markdown:: to_html_with_options( s, & markdown:: Options :: gfm( ) ) ;
9
+ let _ = markdown:: to_mdast( s, & markdown:: ParseOptions :: default ( ) ) ;
10
+ let _ = markdown:: to_mdast( s, & markdown:: ParseOptions :: gfm( ) ) ;
11
+ let _ = markdown:: to_mdast( s, & markdown:: ParseOptions :: mdx( ) ) ;
12
+ }
13
+ } ) ;
14
+ }
15
+ }
File renamed without changes.
Original file line number Diff line number Diff line change @@ -268,7 +268,9 @@ The following bash scripts are useful when working on this project:
268
268
* fuzz:
269
269
` ` ` sh
270
270
cargo install cargo-fuzz
271
- cargo +nightly fuzz run markdown
271
+ cargo install honggfuzz
272
+ cargo +nightly fuzz run markdown_libfuzz
273
+ cargo hfuzz run markdown_honggfuzz
272
274
` ` `
273
275
274
276
# ## Version
You can’t perform that action at this time.
0 commit comments