Merge branch 'fuzz_ptmgr_ipc' into 'main'

ptmgr: Add a fuzzer for ptmessage.

See merge request tpo/core/arti!814
This commit is contained in:
eta 2022-10-27 14:51:35 +00:00
commit 84a2624401
3 changed files with 36 additions and 0 deletions

3
crates/tor-ptmgr/fuzz/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
target
corpus
artifacts

View File

@ -0,0 +1,25 @@
[package]
name = "tor-ptmgr-fuzz"
version = "0.0.0"
authors = ["Automatically generated"]
publish = false
edition = "2018"
[package.metadata]
cargo-fuzz = true
[dependencies]
libfuzzer-sys = "0.4"
[dependencies.tor-ptmgr]
path = ".."
# Prevent this from interfering with workspaces
[workspace]
members = ["."]
[[bin]]
name = "ptmessage"
path = "fuzz_targets/ptmessage.rs"
test = false
doc = false

View File

@ -0,0 +1,8 @@
#![no_main]
use libfuzzer_sys::fuzz_target;
use std::str::FromStr;
use tor_ptmgr::ipc::PtMessage;
fuzz_target!(|data: &str| {
let _ = PtMessage::from_str(data);
});