diff options
author | Alan Modra <amodra@gmail.com> | 2020-03-26 17:57:18 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2020-03-26 20:02:42 +1030 |
commit | ff7685105468702de87b75599b1ea88cc309541c (patch) | |
tree | 13746997503dda4cd78f8d41df6190a634b84803 /bfd | |
parent | 4c4addbe57711f1cdbb72305b8cbd03a68ae2e34 (diff) | |
download | gdb-ff7685105468702de87b75599b1ea88cc309541c.zip gdb-ff7685105468702de87b75599b1ea88cc309541c.tar.gz gdb-ff7685105468702de87b75599b1ea88cc309541c.tar.bz2 |
Re: i386msdos uninitialised read
Another fix.
* i386msdos.c (msdos_object_p): Catch -1 return from bfd_bread.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 4 | ||||
-rw-r--r-- | bfd/i386msdos.c | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index b5a2e7d..441725f 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,9 @@ 2020-03-26 Alan Modra <amodra@gmail.com> + * i386msdos.c (msdos_object_p): Catch -1 return from bfd_bread. + +2020-03-26 Alan Modra <amodra@gmail.com> + * vms-alpha.c (dst_define_location): Limit size of dst_ptr_offsets array. (_bfd_vms_slurp_object_records): Rename "err" to "ok". diff --git a/bfd/i386msdos.c b/bfd/i386msdos.c index e9307a7..38bb441 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); |