public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Segmentation fault i386-gen
@ 2021-01-26 10:29 Alan Modra
  0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2021-01-26 10:29 UTC (permalink / raw)
  To: binutils

A case of inst->next being uninitialised.

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

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);

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-01-26 10:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-26 10:29 Segmentation fault i386-gen Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).