]> 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:27:01 +0000 (08:57 +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 fada4f8c94b516f2e8ab830f94ee905f4a98c540..ced84d63a771a0b62ee564ca94592e18f6f8d445 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.
+
 2020-10-07  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR gas/26685
index 7230f873445a710fe525cf83a94ab70e2c0812a7..09615f6069cf789778a61c2702d5d2120e8839f1 100644 (file)
@@ -1465,6 +1465,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);