public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Uninitialised memory read in z80-dis.c
@ 2020-03-24 22:32 Alan Modra
  0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2020-03-24 22:32 UTC (permalink / raw)
  To: binutils; +Cc: Sergey Belyashov

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

	* z80-dis.c (suffix): Init mybuf.

diff --git a/opcodes/z80-dis.c b/opcodes/z80-dis.c
index b23e8e99fd..cd84044451 100644
--- a/opcodes/z80-dis.c
+++ b/opcodes/z80-dis.c
@@ -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++;

-- 
Alan Modra
Australia Development Lab, IBM

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

only message in thread, other threads:[~2020-03-24 22:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-24 22:32 Uninitialised memory read in z80-dis.c 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).