From: Alan Modra Date: Tue, 31 Mar 2020 04:31:01 +0000 (+1030) Subject: alpha-coff: unitialised read X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;h=89b599df37111317b9bc6fab541eb94c8b0bea35;p=deliverable%2Fbinutils-gdb.git alpha-coff: unitialised read * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Correct bfd_bread return value check. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 1878fd7971..4c2bb14f6c 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2020-03-31 Alan Modra + + * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Correct bfd_bread + return value check. + 2020-03-31 Alan Modra * vms-alpha.c (image_write): Check bounds for sections without diff --git a/bfd/coff-alpha.c b/bfd/coff-alpha.c index b86a8a259b..4fd3b5c488 100644 --- a/bfd/coff-alpha.c +++ b/bfd/coff-alpha.c @@ -2130,7 +2130,7 @@ alpha_ecoff_get_elt_at_filepos (bfd *archive, file_ptr filepos) n = dict[h]; else { - if (! bfd_bread (&n, (bfd_size_type) 1, nbfd)) + if (bfd_bread (&n, 1, nbfd) != 1) goto error_return; dict[h] = n; }