Blame SOURCES/binutils-coffgen-buffer-overrun.patch

afa44e
--- binutils.orig/bfd/coffgen.c	2022-04-25 13:43:52.724745386 +0100
afa44e
+++ binutils-2.30/bfd/coffgen.c	2022-04-25 13:46:39.583596137 +0100
afa44e
@@ -1838,10 +1838,7 @@ coff_get_normalized_symtab (bfd *abfd)
afa44e
       internal_ptr->is_sym = TRUE;
afa44e
 
afa44e
       /* PR 17512: file: 1353-1166-0.004.  */
afa44e
-      if (symbol_ptr->u.syment.n_sclass == C_FILE
afa44e
-	  && symbol_ptr->u.syment.n_numaux > 0
afa44e
-	  && raw_src + symesz + symbol_ptr->u.syment.n_numaux
afa44e
-	  * symesz > raw_end)
afa44e
+      if (symbol_ptr->u.syment.n_numaux > ((raw_end - 1) - raw_src) / symesz)
afa44e
 	{
afa44e
 	  bfd_release (abfd, internal);
afa44e
 	  return NULL;