ptmgr: Add a fuzzer for ptmessage.

This commit is contained in:
Nick Mathewson 2022-10-26 16:59:48 -04:00
parent a8b96534be
commit 42fefe021d
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);
});