aboutsummaryrefslogtreecommitdiff
path: root/fuzz/fuzz_targets/decode_does_not_panic.rs
diff options
context:
space:
mode:
Diffstat (limited to 'fuzz/fuzz_targets/decode_does_not_panic.rs')
-rw-r--r--fuzz/fuzz_targets/decode_does_not_panic.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/fuzz/fuzz_targets/decode_does_not_panic.rs b/fuzz/fuzz_targets/decode_does_not_panic.rs
index fd6efec..7e0c812 100644
--- a/fuzz/fuzz_targets/decode_does_not_panic.rs
+++ b/fuzz/fuzz_targets/decode_does_not_panic.rs
@@ -3,10 +3,13 @@
extern crate yaxpeax_x86;
fuzz_target!(|data: &[u8]| {
+ if data.len() > 15 {
+ return;
+ }
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();
- x86_64_decoder.decode_slice(data).expect("is ok");
- x86_32_decoder.decode_slice(data).expect("is ok");
- x86_16_decoder.decode_slice(data).expect("is ok");
+ let _res = x86_64_decoder.decode_slice(data);
+ let _res = x86_32_decoder.decode_slice(data);
+ let _res = x86_16_decoder.decode_slice(data);
});