Skip to content

Commit 510753f

Browse files
committed
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 c3ffb8f)
1 parent 8a04178 commit 510753f

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

opcodes/ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2021-01-26 Alan Modra <amodra@gmail.com>
2+
3+
* i386-gen.c (parse_template): Ensure entire template_instance
4+
is initialised.
5+
16
2021-01-24 Nick Clifton <nickc@redhat.com>
27

38
* configure: Regenerate.

opcodes/i386-gen.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1576,6 +1576,8 @@ parse_template (char *buf, int lineno)
15761576
*end++ = '\0';
15771577

15781578
inst = xmalloc (sizeof (*inst));
1579+
inst->next = NULL;
1580+
inst->args = NULL;
15791581

15801582
cur = next_field (buf, ':', &next, end);
15811583
inst->name = xstrdup (cur);

0 commit comments

Comments
 (0)