Blame SOURCES/binutils-CVE-2019-9074.patch

a6dfc0
--- binutils.orig/bfd/pei-x86_64.c	2019-02-25 16:12:29.798061414 +0000
a6dfc0
+++ binutils-2.31.1/bfd/pei-x86_64.c	2019-02-25 17:09:02.783425236 +0000
a6dfc0
@@ -541,7 +541,7 @@ pex64_bfd_print_pdata_section (bfd *abfd
a6dfc0
   /* virt_size might be zero for objects.  */
a6dfc0
   if (stop == 0 && strcmp (abfd->xvec->name, "pe-x86-64") == 0)
a6dfc0
     {
a6dfc0
-      stop = (datasize / onaline) * onaline;
a6dfc0
+      stop = datasize;
a6dfc0
       virt_size_is_zero = TRUE;
a6dfc0
     }
a6dfc0
   else if (datasize < stop)
a6dfc0
@@ -551,8 +551,8 @@ pex64_bfd_print_pdata_section (bfd *abfd
a6dfc0
 		 _("Warning: %s section size (%ld) is smaller than virtual size (%ld)\n"),
a6dfc0
 		 pdata_section->name, (unsigned long) datasize,
a6dfc0
 		 (unsigned long) stop);
a6dfc0
-	/* Be sure not to read passed datasize.  */
a6dfc0
-	stop = datasize / onaline;
a6dfc0
+	/* Be sure not to read past datasize.  */
a6dfc0
+	stop = datasize;
a6dfc0
       }
a6dfc0
 
a6dfc0
   /* Display functions table.  */
a6dfc0
@@ -724,8 +724,7 @@ pex64_bfd_print_pdata_section (bfd *abfd
a6dfc0
 	      altent += imagebase;
a6dfc0
 
a6dfc0
 	      if (altent >= pdata_vma
a6dfc0
-		  && (altent + PDATA_ROW_SIZE <= pdata_vma
a6dfc0
-		      + pei_section_data (abfd, pdata_section)->virt_size))
a6dfc0
+		  && altent - pdata_vma + PDATA_ROW_SIZE <= stop)
a6dfc0
 		{
a6dfc0
 		  pex64_get_runtime_function
a6dfc0
 		    (abfd, &arf, &pdata[altent - pdata_vma]);