From: Roland McGrath Date: Thu, 9 Jan 2014 18:13:10 +0000 (-0800) Subject: Fix buffer underrun in i386-dis.c. X-Git-Tag: gdb-7.7-release~52 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c8386be25767c8819fdfa9d24be6bb03ea004a78;p=thirdparty%2Fbinutils-gdb.git Fix buffer underrun in i386-dis.c. opcodes/ * i386-dis.c (print_insn): Do not touch all_prefixes[-1] when last_rex_prefix is -1. (cherry picked from commit e2e6193d65a20e6b7fccba288e5d1bc45b78d194) --- diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index fbb86a3d2a9..66e0365ade0 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,9 @@ +2014-01-09 Bradley Nelson + Roland McGrath + + * i386-dis.c (print_insn): Do not touch all_prefixes[-1] when + last_rex_prefix is -1. + 2014-01-03 Maciej W. Rozycki * nds32-asm.c (parse_operand): Fix out-of-range integer constant. diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c index 2c28e52cc89..f2ec8c4947e 100644 --- a/opcodes/i386-dis.c +++ b/opcodes/i386-dis.c @@ -12645,7 +12645,7 @@ print_insn (bfd_vma pc, disassemble_info *info) } /* Check if the REX prefix is used. */ - if (rex_ignored == 0 && (rex ^ rex_used) == 0) + if (rex_ignored == 0 && (rex ^ rex_used) == 0 && last_rex_prefix >= 0) all_prefixes[last_rex_prefix] = 0; /* Check if the SEG prefix is used. */