From 0e9da8736a809f342f1210be38b01b5bc2da4d96 Mon Sep 17 00:00:00 2001 From: Nguyen Anh Quynh Date: Tue, 16 Jun 2015 11:57:22 +0800 Subject: [PATCH] x86: treat prefix-only sequences of bytes as invalid code. this fixes a NDP reported by @felixgr --- arch/X86/X86DisassemblerDecoder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/X86/X86DisassemblerDecoder.c b/arch/X86/X86DisassemblerDecoder.c index 19a26eed..9421c02f 100644 --- a/arch/X86/X86DisassemblerDecoder.c +++ b/arch/X86/X86DisassemblerDecoder.c @@ -437,7 +437,7 @@ static int readPrefixes(struct InternalInstruction *insn) /* If we fail reading prefixes, just stop here and let the opcode reader deal with it */ if (consumeByte(insn, &byte)) - break; + return -1; if (insn->readerCursor - 1 == insn->startLocation && (byte == 0xf2 || byte == 0xf3)) {