Shallow clone of https://github.com/wooorm/markdown-rs
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
[package]
|
||||
name = "markdown-fuzz"
|
||||
version = "0.0.0"
|
||||
authors = ["Automatically generated"]
|
||||
publish = false
|
||||
edition = "2018"
|
||||
|
||||
[package.metadata]
|
||||
cargo-fuzz = true
|
||||
|
||||
[dependencies]
|
||||
libfuzzer-sys = "0.4"
|
||||
honggfuzz = "0.5"
|
||||
|
||||
[dependencies.markdown]
|
||||
path = ".."
|
||||
|
||||
# Prevent this from interfering with workspaces
|
||||
[workspace]
|
||||
members = ["."]
|
||||
|
||||
[[bin]]
|
||||
name = "markdown_libfuzz"
|
||||
path = "fuzz_targets/markdown_libfuzz.rs"
|
||||
test = false
|
||||
doc = false
|
||||
|
||||
[[bin]]
|
||||
name = "markdown_honggfuzz"
|
||||
path = "fuzz_targets/markdown_honggfuzz.rs"
|
||||
test = false
|
||||
doc = false
|
||||
@@ -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());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -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());
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user