mirror of
https://github.com/n0-computer/noq.git
synced 2026-10-03 12:40:46 +00:00
16 lines
426 B
Rust
16 lines
426 B
Rust
#![no_main]
|
|
|
|
use libfuzzer_sys::fuzz_target;
|
|
use proto::fuzzing::{PacketParams, PartialDecode};
|
|
extern crate proto;
|
|
|
|
fuzz_target!(|data: PacketParams| {
|
|
let len = data.buf.len();
|
|
if let Ok(decoded) = PartialDecode::new(data.buf, data.local_cid_len) {
|
|
match decoded.1 {
|
|
Some(x) => assert_eq!(len, decoded.0.len() + x.len()),
|
|
None => assert_eq!(len, decoded.0.len()),
|
|
}
|
|
}
|
|
});
|