diff options
| author | Edward Barnard | 2017-03-03 12:11:55 +0000 |
|---|---|---|
| committer | Edward Barnard | 2017-03-03 14:05:31 +0000 |
| commit | 4a358659148be6f216a2ed8ea2004b2e744b8fb1 (patch) | |
| tree | 1637cb3acf3e5cdaf80f24b16bdc9de745b06cbd /fuzz | |
| parent | 061874f8865b9f0f14c3bc5e56f2125520a49c87 (diff) | |
| download | rust-plist-4a358659148be6f216a2ed8ea2004b2e744b8fb1.tar.bz2 | |
Add cargo fuzz support.
Diffstat (limited to 'fuzz')
| -rw-r--r-- | fuzz/.gitignore | 5 | ||||
| -rw-r--r-- | fuzz/Cargo.toml | 17 | ||||
| -rw-r--r-- | fuzz/fuzzers/binary_reader.rs | 12 |
3 files changed, 34 insertions, 0 deletions
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/binary_reader.rs b/fuzz/fuzzers/binary_reader.rs new file mode 100644 index 0000000..800ca21 --- /dev/null +++ b/fuzz/fuzzers/binary_reader.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); +} |
