aboutsummaryrefslogtreecommitdiff
path: root/opcodes/i386-gen.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2021-01-26 12:20:23 +1030
committerAlan Modra <amodra@gmail.com>2021-01-26 20:54:43 +1030
commitc3ffb8f340f567949f24c3bab62259f0e593637f (patch)
treeed8dc00dda096d8260d02daa11dafc70bc3a14c1 /opcodes/i386-gen.c
parent1c9c9b9b55520b36c15af94ee0803f0922b3ca09 (diff)
downloadgdb-c3ffb8f340f567949f24c3bab62259f0e593637f.zip
gdb-c3ffb8f340f567949f24c3bab62259f0e593637f.tar.gz
gdb-c3ffb8f340f567949f24c3bab62259f0e593637f.tar.bz2
Segmentation fault i386-gen
A case of inst->next being uninitialised. * i386-gen.c (parse_template): Ensure entire template_instance is initialised.
Diffstat (limited to 'opcodes/i386-gen.c')
-rw-r--r--opcodes/i386-gen.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/opcodes/i386-gen.c b/opcodes/i386-gen.c
index b3c87db..44cdc66 100644
--- a/opcodes/i386-gen.c
+++ b/opcodes/i386-gen.c
@@ -1576,6 +1576,8 @@ parse_template (char *buf, int lineno)
*end++ = '\0';
inst = xmalloc (sizeof (*inst));
+ inst->next = NULL;
+ inst->args = NULL;
cur = next_field (buf, ':', &next, end);
inst->name = xstrdup (cur);