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
88fuzz /target
99fuzz /corpus
1010fuzz /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
1010
1111[dependencies ]
1212libfuzzer-sys = " 0.4"
13+ honggfuzz = " 0.5"
1314
1415[dependencies .markdown ]
1516path = " .."
@@ -19,7 +20,13 @@ path = ".."
1920members = [" ." ]
2021
2122[[bin ]]
22- name = " markdown "
23- path = " fuzz_targets/markdown .rs"
23+ name = " markdown_libfuzz "
24+ path = " fuzz_targets/markdown_libfuzz .rs"
2425test = false
2526doc = 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:
268268* fuzz:
269269 ` ` ` sh
270270 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
272274 ` ` `
273275
274276# ## Version
You can’t perform that action at this time.
0 commit comments