aboutsummaryrefslogtreecommitdiff
path: root/opcodes
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2019-10-29 15:35:30 +0000
committerNick Clifton <nickc@redhat.com>2019-10-29 15:35:30 +0000
commitefea62b44631289f995db16faf70979d6592580b (patch)
tree18d3cf555fe601c9bdc0598389f56e6a941cfb32 /opcodes
parent9adb25915092daa4096911d04fadb5d496c926a6 (diff)
downloadgdb-efea62b44631289f995db16faf70979d6592580b.zip
gdb-efea62b44631289f995db16faf70979d6592580b.tar.gz
gdb-efea62b44631289f995db16faf70979d6592580b.tar.bz2
Fix array overrun when disassembling corrupt TIC30 binaries.
* tic30-dis.c (print_branch): Correct size of operand array.
Diffstat (limited to 'opcodes')
-rw-r--r--opcodes/ChangeLog4
-rw-r--r--opcodes/tic30-dis.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index ae2e00c..cadb065 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,5 +1,9 @@
2019-10-29 Nick Clifton <nickc@redhat.com>
+ * tic30-dis.c (print_branch): Correct size of operand array.
+
+2019-10-29 Nick Clifton <nickc@redhat.com>
+
* d30v-dis.c (print_insn): Check that operand index is valid
before attempting to access the operands array.
diff --git a/opcodes/tic30-dis.c b/opcodes/tic30-dis.c
index a28be83..29948f4 100644
--- a/opcodes/tic30-dis.c
+++ b/opcodes/tic30-dis.c
@@ -607,7 +607,7 @@ print_branch (disassemble_info *info,
unsigned long insn_word,
struct instruction *insn)
{
- char operand[2][13] =
+ char operand[2][OPERAND_BUFFER_LEN] =
{
{0},
{0}