From: Alan Modra Date: Tue, 26 Jan 2021 01:50:23 +0000 (+1030) Subject: Segmentation fault i386-gen X-Git-Tag: binutils-2_36_1~27 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=510753f8484b2402ae4750d9580f05df778dc5ee;p=thirdparty%2Fbinutils-gdb.git Segmentation fault i386-gen A case of inst->next being uninitialised. * i386-gen.c (parse_template): Ensure entire template_instance is initialised. (cherry picked from commit c3ffb8f340f567949f24c3bab62259f0e593637f) --- diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 60ac669c466..4d3d8d7acd4 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,8 @@ +2021-01-26 Alan Modra + + * i386-gen.c (parse_template): Ensure entire template_instance + is initialised. + 2021-01-24 Nick Clifton * configure: Regenerate. diff --git a/opcodes/i386-gen.c b/opcodes/i386-gen.c index b3c87dbbd66..44cdc661985 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);