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

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