aboutsummaryrefslogtreecommitdiff
path: root/disas
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2017-03-03 15:50:29 +0000
committerPeter Maydell <peter.maydell@linaro.org>2017-03-07 14:33:51 +0000
commit3f168b5d353fa68baab55ea0c6ba791f0df027dc (patch)
tree3aacbb365856de56b9ca8e7a3bed05fadd5d6072 /disas
parent6815a8a00a8f3fd380fb5f87b934694c78d20ec4 (diff)
disas/i386: Avoid NULL pointer dereference in error case
In a code path where we hit an internal disassembler error, execution would subsequently attempt to dereference a NULL pointer. This should never happen, but avoid the crash. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1488556233-31246-3-git-send-email-peter.maydell@linaro.org
Diffstat (limited to 'disas')
-rw-r--r--disas/i386.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/disas/i386.c b/disas/i386.c
index 07f871fd64..f1e376ca4a 100644
--- a/disas/i386.c
+++ b/disas/i386.c
@@ -4043,7 +4043,7 @@ print_insn (bfd_vma pc, disassemble_info *info)
}
}
- if (putop (dp->name, sizeflag) == 0)
+ if (dp->name != NULL && putop (dp->name, sizeflag) == 0)
{
for (i = 0; i < MAX_OPERANDS; ++i)
{