From: Alan Modra <amodra@gmail.com>
To: binutils@sourceware.org
Subject: metag uninitialized memory read
Date: Fri, 20 Mar 2020 12:38:22 +1030 [thread overview]
Message-ID: <20200320020822.GH4583@bubble.grove.modra.org> (raw)
* metag-dis.c (print_insn_metag): Don't ignore status from
read_memory_func.
diff --git a/opcodes/metag-dis.c b/opcodes/metag-dis.c
index f01dcbaef1..b1cf6331b5 100644
--- a/opcodes/metag-dis.c
+++ b/opcodes/metag-dis.c
@@ -3364,9 +3364,15 @@ print_insn_metag (bfd_vma pc, disassemble_info *outf)
bfd_byte buf[4];
unsigned int insn_word;
size_t i;
- outf->bytes_per_chunk = 4;
+ int status;
- (*outf->read_memory_func) (pc & ~0x03, buf, 4, outf);
+ outf->bytes_per_chunk = 4;
+ status = (*outf->read_memory_func) (pc & ~0x03, buf, 4, outf);
+ if (status)
+ {
+ (*outf->memory_error_func) (status, pc, outf);
+ return -1;
+ }
insn_word = bfd_getl32 (buf);
for (i = 0; i < sizeof(metag_optab)/sizeof(metag_optab[0]); i++)
--
Alan Modra
Australia Development Lab, IBM
reply other threads:[~2020-03-20 2:08 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=20200320020822.GH4583@bubble.grove.modra.org \
--to=amodra@gmail.com \
--cc=binutils@sourceware.org \
/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).