mirror of
https://github.com/ZeusWPI/ZNS.git
synced 2024-11-27 22:51:12 +01:00
add fuzzer
This commit is contained in:
parent
341f79f5ad
commit
9c3d152618
3 changed files with 21 additions and 1 deletions
|
@ -17,3 +17,10 @@ path = "fuzz_targets/parser.rs"
|
|||
test = false
|
||||
doc = false
|
||||
bench = false
|
||||
|
||||
[[bin]]
|
||||
name = "parser_to_bytes"
|
||||
path = "fuzz_targets/parser_to_bytes.rs"
|
||||
test = false
|
||||
doc = false
|
||||
bench = false
|
||||
|
|
|
@ -1,9 +1,14 @@
|
|||
#![no_main]
|
||||
|
||||
use libfuzzer_sys::fuzz_target;
|
||||
use zns::{parser::FromBytes, reader::Reader, structs::Message};
|
||||
use zns::{
|
||||
parser::{FromBytes},
|
||||
reader::Reader,
|
||||
structs::Message,
|
||||
};
|
||||
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
let mut reader = Reader::new(data);
|
||||
let _ = Message::from_bytes(&mut reader);
|
||||
});
|
||||
|
||||
|
|
8
fuzz/fuzz_targets/parser_to_bytes.rs
Normal file
8
fuzz/fuzz_targets/parser_to_bytes.rs
Normal file
|
@ -0,0 +1,8 @@
|
|||
#![no_main]
|
||||
|
||||
use libfuzzer_sys::fuzz_target;
|
||||
use zns::{parser::ToBytes, structs::Message};
|
||||
|
||||
fuzz_target!(|message: Message| {
|
||||
let _ = Message::to_bytes(message);
|
||||
});
|
Loading…
Reference in a new issue