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

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