Skip to content

Commit

Permalink
Merge #46
Browse files Browse the repository at this point in the history
46: Add fuzz target for serde_yaml r=frewsxcv
Fixes #32
  • Loading branch information
bors-ng[bot] committed Mar 15, 2017
2 parents 34183cb + 4f3b513 commit 309b6d3
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 0 deletions.
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

0 comments on commit 309b6d3

Please sign in to comment.