diff --git a/tools/fuzz/x86_instruction_emulator/fuzz-emul.c b/tools/fuzz/x86_instruction_emulator/fuzz-emul.c index 65c5a3bcf3..64b7fb230e 100644 --- a/tools/fuzz/x86_instruction_emulator/fuzz-emul.c +++ b/tools/fuzz/x86_instruction_emulator/fuzz-emul.c @@ -117,6 +117,16 @@ static int fuzz_insn_fetch( unsigned int bytes, struct x86_emulate_ctxt *ctxt) { + /* + * Zero-length instruction fetches are made at the destination of jumps, + * to perform segmentation checks. No data needs returning. + */ + if ( bytes == 0 ) + { + assert(p_data == NULL); + return maybe_fail("insn_fetch", true); + } + return data_read("insn_fetch", p_data, bytes); }