]> 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:04 +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 0b72d5b6fe22d369aadb8f5aa3286c188027dd68..c168d65d1194daa4dde8f19524a5f9a734439257 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.
+
 2013-11-20  Yufeng Zhang  <yufeng.zhang@arm.com>
 
        * aarch64-opc.c (aarch64_pstatefields): Update.
index 8e55724477a27cc73a0ac7430ecefa5cebff7a53..d27827292d250aabc2e6f1d7020180de9131c0ab 100644 (file)
@@ -12635,7 +12635,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.  */