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

381f6c
--- binutils.orig/bfd/elfcode.h	2018-05-01 11:42:03.250424443 +0100
381f6c
+++ binutils-2.30/bfd/elfcode.h	2018-05-01 12:41:00.745780026 +0100
381f6c
@@ -680,7 +680,7 @@ elf_object_p (bfd *abfd)
381f6c
       if (i_ehdrp->e_shnum > ((bfd_size_type) -1) / sizeof (*i_shdrp))
381f6c
 	goto got_wrong_format_error;
381f6c
 #endif
381f6c
-      amt = sizeof (*i_shdrp) * i_ehdrp->e_shnum;
381f6c
+      amt = sizeof (*i_shdrp) * (bfd_size_type) i_ehdrp->e_shnum;
381f6c
       i_shdrp = (Elf_Internal_Shdr *) bfd_alloc (abfd, amt);
381f6c
       if (!i_shdrp)
381f6c
 	goto got_no_match;
381f6c
@@ -776,7 +776,7 @@ elf_object_p (bfd *abfd)
381f6c
       if (i_ehdrp->e_phnum > ((bfd_size_type) -1) / sizeof (*i_phdr))
381f6c
 	goto got_wrong_format_error;
381f6c
 #endif
381f6c
-      amt = i_ehdrp->e_phnum * sizeof (*i_phdr);
381f6c
+      amt = (bfd_size_type) i_ehdrp->e_phnum * sizeof (*i_phdr);
381f6c
       elf_tdata (abfd)->phdr = (Elf_Internal_Phdr *) bfd_alloc (abfd, amt);
381f6c
       if (elf_tdata (abfd)->phdr == NULL)
381f6c
 	goto got_no_match;