From 26e019cc3788b6bac73969dc3d1753e883961339 Mon Sep 17 00:00:00 2001 From: iximeow Date: Sun, 19 Dec 2021 11:32:43 -0800 Subject: add in-tree cargo fuzz targets for decode and display impls --- fuzz/fuzz_targets/decode_does_not_panic.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 fuzz/fuzz_targets/decode_does_not_panic.rs (limited to 'fuzz/fuzz_targets/decode_does_not_panic.rs') diff --git a/fuzz/fuzz_targets/decode_does_not_panic.rs b/fuzz/fuzz_targets/decode_does_not_panic.rs new file mode 100644 index 0000000..5e6c15d --- /dev/null +++ b/fuzz/fuzz_targets/decode_does_not_panic.rs @@ -0,0 +1,12 @@ +#![no_main] +#[macro_use] extern crate libfuzzer_sys; +extern crate yaxpeax_x86; + +fuzz_target!(|data: &[u8]| { + let x86_64_decoder = yaxpeax_x86::long_mode::InstDecoder::default(); + let x86_32_decoder = yaxpeax_x86::protected_mode::InstDecoder::default(); + let x86_16_decoder = yaxpeax_x86::real_mode::InstDecoder::default(); + drop(x86_64_decoder.decode_slice(data)); + drop(x86_32_decoder.decode_slice(data)); + drop(x86_16_decoder.decode_slice(data)); +}); -- cgit v1.1