From b3a921c761309ae00a51fe348d8a43adbc54b518 Mon Sep 17 00:00:00 2001 From: Christian Murphy Date: Sat, 1 Apr 2023 03:09:26 -0700 Subject: Add `honggfuzz` as an alternative fuzzer Closes GH-55. Reviewed-by: Titus Wormer --- fuzz/fuzz_targets/markdown_honggfuzz.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 fuzz/fuzz_targets/markdown_honggfuzz.rs (limited to 'fuzz/fuzz_targets/markdown_honggfuzz.rs') diff --git a/fuzz/fuzz_targets/markdown_honggfuzz.rs b/fuzz/fuzz_targets/markdown_honggfuzz.rs new file mode 100644 index 0000000..6aa3c79 --- /dev/null +++ b/fuzz/fuzz_targets/markdown_honggfuzz.rs @@ -0,0 +1,15 @@ +use honggfuzz::fuzz; + +fn main() { + loop { + fuzz!(|data: &[u8]| { + if let Ok(s) = std::str::from_utf8(data) { + let _ = markdown::to_html(s); + let _ = markdown::to_html_with_options(s, &markdown::Options::gfm()); + let _ = markdown::to_mdast(s, &markdown::ParseOptions::default()); + let _ = markdown::to_mdast(s, &markdown::ParseOptions::gfm()); + let _ = markdown::to_mdast(s, &markdown::ParseOptions::mdx()); + } + }); + } +} -- cgit