Skip to content
Open
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
3 changes: 3 additions & 0 deletions quick-protobuf/fuzz/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
target
corpus
artifacts
28 changes: 28 additions & 0 deletions quick-protobuf/fuzz/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[package]
name = "quick-protobuf-fuzz"
version = "0.0.0"
authors = ["Automatically generated"]
publish = false
edition = "2018"

[profile.dev]
debug = 2

[package.metadata]
cargo-fuzz = true

[dependencies]
libfuzzer-sys = "0.4"

[dependencies.quick-protobuf]
path = ".."

# Prevent this from interfering with workspaces
[workspace]
members = ["."]

[[bin]]
name = "foomessage"
path = "fuzz_targets/foomessage.rs"
test = false
doc = false
11 changes: 11 additions & 0 deletions quick-protobuf/fuzz/fuzz_targets/foomessage.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#![no_main]
use libfuzzer_sys::fuzz_target;
use quick_protobuf::{BytesReader, MessageRead};

fuzz_target!(|data: &[u8]| {
let mut r = BytesReader::from_bytes(data);
let _ = pb_rs::data_types::FooMessage::from_reader(&mut r, data);
});

#[path = "../../examples/pb_rs/mod.rs"]
mod pb_rs;