From 89b599df37111317b9bc6fab541eb94c8b0bea35 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 31 Mar 2020 15:01:01 +1030 Subject: [PATCH 1/1] alpha-coff: unitialised read * coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Correct bfd_bread return value check. --- bfd/ChangeLog | 5 +++++ bfd/coff-alpha.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) 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; } -- 2.34.1