alpha-coff: unitialised read

Message ID 20200331062741.GA4583@bubble.grove.modra.org
State New
Headers show
Series
  • alpha-coff: unitialised read
Related show

Commit Message

H.J. Lu via Binutils March 31, 2020, 6:27 a.m.
* coff-alpha.c (alpha_ecoff_get_elt_at_filepos): Correct bfd_bread
	return value check.


-- 
Alan Modra
Australia Development Lab, IBM

Patch

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;
 		}