mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-02-23 13:21:43 +08:00
coff_get_normalized_symtab bfd_release
We can't free "internal" on errors, since bfd_coff_swap_sym_in may call bfd_alloc. For example, _bfd_XXi_swap_sym_in may even create new sections, which use bfd_alloc'd memory. If "internal" is freed, all more recently bfd_alloc'd memory is also freed. * coffgen.c (coff_get_normalized_symtab): Don't bfd_release on error.
This commit is contained in:
parent
347ab61778
commit
bcefc6be97
@ -1753,10 +1753,7 @@ coff_get_normalized_symtab (bfd *abfd)
|
||||
|
||||
/* PR 17512: Prevent buffer overrun. */
|
||||
if (symbol_ptr->u.syment.n_numaux > ((raw_end - 1) - raw_src) / symesz)
|
||||
{
|
||||
bfd_release (abfd, internal);
|
||||
return NULL;
|
||||
}
|
||||
return NULL;
|
||||
|
||||
for (i = 0;
|
||||
i < symbol_ptr->u.syment.n_numaux;
|
||||
|
Loading…
Reference in New Issue
Block a user