panorama/imap/fuzz/fuzz_targets/parse_response.rs

17 lines
447 B
Rust
Raw Normal View History

2021-08-23 06:52:20 +00:00
#![no_main]
use std::io::Cursor;
use format_bytes::write_bytes;
use libfuzzer_sys::fuzz_target;
use panorama_imap::proto::{response::Response, rfc3501::response};
use panorama_proto_common::Bytes;
fuzz_target!(|resp: Response| {
let data = Vec::new();
let mut curs = Cursor::new(data);
write_bytes!(&mut curs, b"{}", resp).unwrap();
let data = curs.into_inner();
let data = Bytes::from(data);
let _ = response(data);
});