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

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