From ee60471858b9e3b55341d4f09aacd4093bc6135e Mon Sep 17 00:00:00 2001 From: Bradlee Speice Date: Wed, 25 Jul 2018 00:10:30 -0400 Subject: [PATCH] Initial restore from dtparse --- .gitignore | 2 ++ Cargo.toml | 23 +++++++++++++++++++++++ fuzzers/fuzzer_script_1.rs | 10 ++++++++++ 3 files changed, 35 insertions(+) create mode 100644 .gitignore create mode 100644 Cargo.toml create mode 100644 fuzzers/fuzzer_script_1.rs diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2c96eb1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +target/ +Cargo.lock diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..4d6684b --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,23 @@ + +[package] +name = "dtparse-fuzz" +version = "0.0.1" +authors = ["Automatically generated"] +publish = false + +[package.metadata] +cargo-fuzz = true + +[dependencies] +dtparse = "0.9" + +[dependencies.libfuzzer-sys] +git = "https://github.com/rust-fuzz/libfuzzer-sys.git" + +# Prevent this from interfering with workspaces +[workspace] +members = ["."] + +[[bin]] +name = "fuzzer_script_1" +path = "fuzzers/fuzzer_script_1.rs" diff --git a/fuzzers/fuzzer_script_1.rs b/fuzzers/fuzzer_script_1.rs new file mode 100644 index 0000000..92cd04c --- /dev/null +++ b/fuzzers/fuzzer_script_1.rs @@ -0,0 +1,10 @@ +#![no_main] +extern crate libfuzzer_sys; +extern crate dtparse; +use dtparse::parse; +#[export_name="rust_fuzzer_test_input"] +pub extern fn go(data: &[u8]) { + if let Ok(s) = std::str::from_utf8(data) { + parse(s); + } +}