forked from Imagelibrary/binutils-gdb
Fix an illegal memory access in the BFD library which can be triggered by attempting to parse a corrupt PE format file.
PR26240 * coffgen.c (coff_get_normalized_symtab): Fix off-by-one error in check for aux entries that overflow the buufer.
This commit is contained in:
@@ -1814,7 +1814,7 @@ coff_get_normalized_symtab (bfd *abfd)
|
||||
internal_ptr->is_sym = TRUE;
|
||||
|
||||
/* PR 17512: Prevent buffer overrun. */
|
||||
if (symbol_ptr->u.syment.n_numaux > (raw_end - raw_src) / symesz)
|
||||
if (symbol_ptr->u.syment.n_numaux > ((raw_end - 1) - raw_src) / symesz)
|
||||
{
|
||||
bfd_release (abfd, internal);
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user