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

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