From: Alan Modra <amodra@gmail.com>
To: binutils@sourceware.org
Subject: Re: i386msdos uninitialised read
Date: Thu, 26 Mar 2020 20:04:58 +1030 [thread overview]
Message-ID: <20200326093458.GK4583@bubble.grove.modra.org> (raw)
In-Reply-To: <20200323125833.GT4583@bubble.grove.modra.org>
Another fix.
* i386msdos.c (msdos_object_p): Catch -1 return from bfd_bread.
diff --git a/bfd/i386msdos.c b/bfd/i386msdos.c
index e9307a7a42..38bb441034 100644
--- a/bfd/i386msdos.c
+++ b/bfd/i386msdos.c
@@ -50,7 +50,7 @@ msdos_object_p (bfd *abfd)
bfd_size_type size;
if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0
- || (size = bfd_bread (&hdr, sizeof (hdr), abfd)) < DOS_HDR_SIZE)
+ || (size = bfd_bread (&hdr, sizeof (hdr), abfd)) + 1 < DOS_HDR_SIZE + 1)
{
if (bfd_get_error () != bfd_error_system_call)
bfd_set_error (bfd_error_wrong_format);
--
Alan Modra
Australia Development Lab, IBM
prev parent reply other threads:[~2020-03-26 9:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-23 12:58 Alan Modra
2020-03-26 9:34 ` Alan Modra [this message]
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=20200326093458.GK4583@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).