]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Segmentation fault i386-gen
authorAlan Modra <amodra@gmail.com>
Tue, 26 Jan 2021 01:50:23 +0000 (12:20 +1030)
committerAlan Modra <amodra@gmail.com>
Tue, 26 Jan 2021 22:14:12 +0000 (08:44 +1030)
A case of inst->next being uninitialised.

* i386-gen.c (parse_template): Ensure entire template_instance
is initialised.

(cherry picked from commit c3ffb8f340f567949f24c3bab62259f0e593637f)

opcodes/ChangeLog
opcodes/i386-gen.c

index 60ac669c46657dcb74109e6011f47419001fb219..4d3d8d7acd4d8ea84727f3d5e39fc4dbbafad70c 100644 (file)
@@ -1,3 +1,8 @@
+2021-01-26  Alan Modra  <amodra@gmail.com>
+
+       * i386-gen.c (parse_template): Ensure entire template_instance
+       is initialised.
+
 2021-01-24  Nick Clifton  <nickc@redhat.com>
 
        * configure: Regenerate.
index b3c87dbbd662ef29dfb1bdca1456a26f09c944bb..44cdc66198595bbc1790af1c922c5870d0dd912e 100644 (file)
@@ -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);