public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Alan Modra <amodra@gmail.com>
To: binutils@sourceware.org
Cc: Sergey Belyashov <sergey.belyashov@gmail.com>
Subject: Uninitialised memory read in z80-dis.c
Date: Wed, 25 Mar 2020 09:02:16 +1030	[thread overview]
Message-ID: <20200324223216.GZ4583@bubble.grove.modra.org> (raw)

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

                 reply	other threads:[~2020-03-24 22:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200324223216.GZ4583@bubble.grove.modra.org \
    --to=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=sergey.belyashov@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).