]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix buffer underrun in i386-dis.c.
authorRoland McGrath <mcgrathr@google.com>
Thu, 9 Jan 2014 18:13:10 +0000 (10:13 -0800)
committerRoland McGrath <mcgrathr@google.com>
Thu, 9 Jan 2014 19:24:40 +0000 (11:24 -0800)
opcodes/
* i386-dis.c (print_insn): Do not touch all_prefixes[-1] when
last_rex_prefix is -1.

(cherry picked from commit e2e6193d65a20e6b7fccba288e5d1bc45b78d194)

opcodes/ChangeLog
opcodes/i386-dis.c

index fbb86a3d2a90c4c039811e83cea280081ec656b5..66e0365ade059aadb4008ff05c5a08d99c1b96cc 100644 (file)
@@ -1,3 +1,9 @@
+2014-01-09  Bradley Nelson  <bradnelson@google.com>
+           Roland McGrath  <mcgrathr@google.com>
+
+       * i386-dis.c (print_insn): Do not touch all_prefixes[-1] when
+       last_rex_prefix is -1.
+
 2014-01-03  Maciej W. Rozycki  <macro@codesourcery.com>
 
        * nds32-asm.c (parse_operand): Fix out-of-range integer constant.
index 2c28e52cc89666bf64da9b141a0050c03adbf4a8..f2ec8c4947ee7d4e16312aea5d65eb183fc216f2 100644 (file)
@@ -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.  */