Skip to content

Commit

Permalink
Add fuzz target for bson crate
Browse files Browse the repository at this point in the history
  • Loading branch information
killercup committed Mar 14, 2017
1 parent 34183cb commit 8cb1829
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[workspace]
members = [
"bson",
"crypto-hashes",
"cssparser",
"flac",
Expand Down
12 changes: 12 additions & 0 deletions bson/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "bson-targets"
version = "0.0.0"
publish = false

[dependencies]
bson = { git = "https://github.com/zonyitoo/bson-rs" }
libfuzzer-sys = { git = "https://github.com/rust-fuzz/libfuzzer-sys.git" }

[[bin]]
name = "read_bson"
path = "read_bson.rs"
8 changes: 8 additions & 0 deletions bson/read_bson.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 bson;

fuzz_target!(|data| {
let _ = bson::decode_document(&mut std::io::Cursor::new(data));
});
Binary file added bson/seeds/0001
Binary file not shown.

0 comments on commit 8cb1829

Please sign in to comment.