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

15 lines
589 B
Diff
Raw Normal View History

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