Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fuzz target for serde_yaml #46

Merged
1 commit merged into from
Mar 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ members = [
"regex",
"rustfmt",
"serde_json",
"serde_yaml",
"tar",
"xml-rs",
]
12 changes: 12 additions & 0 deletions serde_yaml/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "serde_yaml-targets"
version = "0.0.0"
publish = false

[dependencies]
serde_yaml = { git = "https://github.com/dtolnay/serde-yaml" }
libfuzzer-sys = { git = "https://github.com/rust-fuzz/libfuzzer-sys.git" }

[[bin]]
name = "read_yaml"
path = "read_yaml.rs"
8 changes: 8 additions & 0 deletions serde_yaml/read_yaml.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#![no_main]

#[macro_use] extern crate libfuzzer_sys;
extern crate serde_yaml;

fuzz_target!(|data| {
let _ = serde_yaml::from_slice::<serde_yaml::Value>(data);
});
25 changes: 25 additions & 0 deletions serde_yaml/seeds/0001
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
none_f:
&none_f
~
none_s:
&none_s
~
none_b:
&none_b
~
some_f:
&some_f
1.0
some_s:
&some_s
x
some_b:
&some_b
true
a: *none_f
b: *none_s
c: *none_b
d: *some_f
e: *some_s
f: *some_b"
7 changes: 7 additions & 0 deletions serde_yaml/seeds/0002
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
first:
&alias
1
second:
*alias
third: 3