aboutsummaryrefslogtreecommitdiffstats
path: root/fuzz/fuzz_targets/markdown_libfuzz.rs
diff options
context:
space:
mode:
Diffstat (limited to 'fuzz/fuzz_targets/markdown_libfuzz.rs')
-rw-r--r--fuzz/fuzz_targets/markdown_libfuzz.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/fuzz/fuzz_targets/markdown_libfuzz.rs b/fuzz/fuzz_targets/markdown_libfuzz.rs
new file mode 100644
index 0000000..ca6d86b
--- /dev/null
+++ b/fuzz/fuzz_targets/markdown_libfuzz.rs
@@ -0,0 +1,12 @@
+#![no_main]
+use libfuzzer_sys::fuzz_target;
+
+fuzz_target!(|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());
+ }
+});