Fuzz: Add target for Probe::read

This commit is contained in:
Serial 2023-10-22 23:39:11 -04:00 committed by Alex
parent 8c9ec0f178
commit 8a7f91582b
2 changed files with 16 additions and 0 deletions

View file

@ -89,3 +89,7 @@ path = "fuzz_targets/picture_from_flac_bytes.rs"
[[bin]]
name = "picture_from_ape_bytes"
path = "fuzz_targets/picture_from_ape_bytes.rs"
[[bin]]
name = "probe_read"
path = "fuzz_targets/probe_read.rs"

View file

@ -0,0 +1,12 @@
#![no_main]
use std::io::Cursor;
use libfuzzer_sys::fuzz_target;
use lofty::Probe;
fuzz_target!(|data: Vec<u8>| {
if let Ok(probe) = Probe::new(&mut Cursor::new(data)).guess_file_type() {
let _ = probe.read();
}
});