[binutils-gdb] Segmentation fault i386-gen
Alan Modra
amodra@sourceware.org
Tue Jan 26 10:30:44 GMT 2021
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=c3ffb8f340f567949f24c3bab62259f0e593637f
commit c3ffb8f340f567949f24c3bab62259f0e593637f
Author: Alan Modra <amodra@gmail.com>
Date: Tue Jan 26 12:20:23 2021 +1030
Segmentation fault i386-gen
A case of inst->next being uninitialised.
* i386-gen.c (parse_template): Ensure entire template_instance
is initialised.
Diff:
---
opcodes/ChangeLog | 5 +++++
opcodes/i386-gen.c | 2 ++
2 files changed, 7 insertions(+)
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 57240f11873..ecbf005e991 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -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-15 Nelson Chu <nelson.chu@sifive.com>
* riscv-opc.c (riscv_gpr_names_abi): Aligned the code.
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);
More information about the Binutils-cvs
mailing list