Skip to content

Commit

Permalink
Fuzzing for map fields
Browse files Browse the repository at this point in the history
  • Loading branch information
stepancheg committed Jun 10, 2018
1 parent de6fd75 commit 7f798c3
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
8 changes: 8 additions & 0 deletions protobuf-fuzz/fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,11 @@ path = "fuzz_targets/repeated.rs"
[[bin]]
name = "repeated_read"
path = "fuzz_targets/repeated_read.rs"

[[bin]]
name = "map"
path = "fuzz_targets/map.rs"

[[bin]]
name = "map_read"
path = "fuzz_targets/map_read.rs"
7 changes: 7 additions & 0 deletions protobuf-fuzz/fuzz/fuzz_targets/map.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#![no_main]
#[macro_use] extern crate libfuzzer_sys;
extern crate protobuf_fuzz;

fuzz_target!(|data: &[u8]| {
protobuf_fuzz::fuzz_target_map(data)
});
7 changes: 7 additions & 0 deletions protobuf-fuzz/fuzz/fuzz_targets/map_read.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#![no_main]
#[macro_use] extern crate libfuzzer_sys;
extern crate protobuf_fuzz;

fuzz_target!(|data: &[u8]| {
protobuf_fuzz::fuzz_target_map_read(data)
});
8 changes: 8 additions & 0 deletions protobuf-fuzz/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,11 @@ pub fn fuzz_target_repeated(bytes: &[u8]) {
pub fn fuzz_target_repeated_read(bytes: &[u8]) {
test_read::<all_types_pb::TestTypesRepeated>(bytes);
}

pub fn fuzz_target_map(bytes: &[u8]) {
test_bytes::<all_types_pb::TestTypesMap>(bytes);
}

pub fn fuzz_target_map_read(bytes: &[u8]) {
test_read::<all_types_pb::TestTypesMap>(bytes);
}

0 comments on commit 7f798c3

Please sign in to comment.