From 5079a605a8ab1b89cb745a727dfb64b3b2e8600e Mon Sep 17 00:00:00 2001 From: iximeow Date: Mon, 29 Sep 2025 01:35:33 +0000 Subject: add display/decode fuzzing, which caught a few issues --- fuzz/fuzz_targets/display_does_not_panic.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 fuzz/fuzz_targets/display_does_not_panic.rs (limited to 'fuzz/fuzz_targets') diff --git a/fuzz/fuzz_targets/display_does_not_panic.rs b/fuzz/fuzz_targets/display_does_not_panic.rs new file mode 100644 index 0000000..f26a268 --- /dev/null +++ b/fuzz/fuzz_targets/display_does_not_panic.rs @@ -0,0 +1,16 @@ +#![no_main] +#[macro_use] extern crate libfuzzer_sys; +extern crate yaxpeax_ia64; + +use yaxpeax_arch::{Decoder, U8Reader}; + +fuzz_target!(|data: &[u8]| { + let ia64_decoder = yaxpeax_ia64::InstDecoder::default(); + + let mut reader = U8Reader::new(data); + + if let Ok(inst) = ia64_decoder.decode(&mut reader) { + let mut out = String::new(); + let res = format!("{inst}"); + } +}); -- cgit v1.1