Uninitialised memory read in z80-dis.c

objdump -d -m ez80-adl testcase:
 .byte 0x40,0xfd

	* z80-dis.c (suffix): Init mybuf.
This commit is contained in:
Alan Modra 2020-03-25 08:50:21 +10:30
parent 5ab2fbf185
commit a18cd0cab4
2 changed files with 5 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2020-03-25 Alan Modra <amodra@gmail.com>
* z80-dis.c (suffix): Init mybuf.
2020-03-22 Alan Modra <amodra@gmail.com>
* h8300-dis.c (bfd_h8_disassemble): Limit data[] access to that

View File

@ -804,6 +804,7 @@ suffix (struct buffer *buf, disassemble_info *info, const char *txt)
old_stream = info->stream;
info->fprintf_func = (fprintf_ftype) &sprintf;
info->stream = mybuf;
mybuf[0] = 0;
buf->base++;
if (print_insn_z80_buf (buf, info) >= 0)
buf->n_used++;