Blame SOURCES/binutils-CVE-2018-10534.patch

381f6c
--- binutils.orig/bfd/peXXigen.c	2018-05-10 10:09:03.619147342 +0100
381f6c
+++ binutils-2.30/bfd/peXXigen.c	2018-05-10 10:20:20.884883540 +0100
381f6c
@@ -2991,6 +2991,15 @@ _bfd_XX_bfd_copy_private_bfd_data_common
381f6c
 				  bfd_get_section_size (section) - (addr - section->vma));
381f6c
 	      return FALSE;
381f6c
 	    }
381f6c
+	  /* PR 23110.  */
381f6c
+	  else if (ope->pe_opthdr.DataDirectory[PE_DEBUG_DATA].Size < 0)
381f6c
+	    {
381f6c
+	      /* xgettext:c-format */
381f6c
+	      _bfd_error_handler
381f6c
+		(_("%pB: Data Directory size (%#lx) is negative"),
381f6c
+		 obfd, ope->pe_opthdr.DataDirectory[PE_DEBUG_DATA].Size);
381f6c
+	      return FALSE;
381f6c
+	    }
381f6c
 
381f6c
 	  for (i = 0; i < ope->pe_opthdr.DataDirectory[PE_DEBUG_DATA].Size
381f6c
 		 / sizeof (struct external_IMAGE_DEBUG_DIRECTORY); i++)