aboutsummaryrefslogtreecommitdiff
path: root/opcodes/i386-dis.c
diff options
context:
space:
mode:
authorRoland McGrath <mcgrathr@google.com>2014-01-09 10:13:10 -0800
committerRoland McGrath <mcgrathr@google.com>2014-01-09 11:22:59 -0800
commite2e6193d65a20e6b7fccba288e5d1bc45b78d194 (patch)
tree234462e90dba8ec8d644584b45bb472b08b2dcc5 /opcodes/i386-dis.c
parent0000e5ccd8615d632ac6ddc831cd5d3af8084737 (diff)
downloadgdb-e2e6193d65a20e6b7fccba288e5d1bc45b78d194.zip
gdb-e2e6193d65a20e6b7fccba288e5d1bc45b78d194.tar.gz
gdb-e2e6193d65a20e6b7fccba288e5d1bc45b78d194.tar.bz2
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.
Diffstat (limited to 'opcodes/i386-dis.c')
-rw-r--r--opcodes/i386-dis.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c
index 2c28e52..f2ec8c4 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. */