aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdward Barnard2017-03-03 12:11:55 +0000
committerEdward Barnard2017-03-03 12:11:55 +0000
commit41e5fe9c3197da4ede35c1bfeaa21316d699848a (patch)
tree8bcfb7ac5dd5617ab609ccf9d705e4c2ed47dc22
parent061874f8865b9f0f14c3bc5e56f2125520a49c87 (diff)
downloadrust-plist-41e5fe9c3197da4ede35c1bfeaa21316d699848a.tar.bz2
Fuzzer support
-rw-r--r--Cargo.toml2
-rw-r--r--fuzz/.gitignore5
-rw-r--r--fuzz/Cargo.toml17
-rw-r--r--fuzz/fuzzers/fuzzer_script_1.rs12
4 files changed, 35 insertions, 1 deletions
diff --git a/Cargo.toml b/Cargo.toml
index e53a0fd..575a6d4 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -15,7 +15,7 @@ serde_serialization = ["serde"]
[dependencies]
rustc-serialize = "0.3.19"
-xml-rs = "0.3.8"
+xml-rs = "0.3.6"
byteorder = "0.5.3"
chrono = "0.2.22"
serde = { version = "0.9.5", optional = true }
diff --git a/fuzz/.gitignore b/fuzz/.gitignore
new file mode 100644
index 0000000..dfeb7db
--- /dev/null
+++ b/fuzz/.gitignore
@@ -0,0 +1,5 @@
+
+target
+libfuzzer
+corpus
+artifacts
diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml
new file mode 100644
index 0000000..d1935db
--- /dev/null
+++ b/fuzz/Cargo.toml
@@ -0,0 +1,17 @@
+
+[package]
+name = "plist-fuzz"
+version = "0.0.1"
+authors = ["Automatically generated"]
+publish = false
+
+[dependencies.plist]
+path = ".."
+
+# Prevent this from interfering with workspaces
+[workspace]
+members = ["."]
+
+[[bin]]
+name = "fuzzer_script_1"
+path = "fuzzers/fuzzer_script_1.rs"
diff --git a/fuzz/fuzzers/fuzzer_script_1.rs b/fuzz/fuzzers/fuzzer_script_1.rs
new file mode 100644
index 0000000..800ca21
--- /dev/null
+++ b/fuzz/fuzzers/fuzzer_script_1.rs
@@ -0,0 +1,12 @@
+#![no_main]
+extern crate libfuzzer_sys;
+extern crate plist;
+
+use std::io::Cursor;
+use plist::Plist;
+
+#[export_name="rust_fuzzer_test_input"]
+pub extern fn go(data: &[u8]) {
+ let cursor = Cursor::new(data);
+ let _ = Plist::read(cursor);
+}