mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-17 07:53:51 +08:00
Fix memory access problems exposed by fuzzed binaries.
PR binutils/17512 * objdump.c (free_debug_section): Reset the compress_status as well. * compress.c (bfd_get_full_section_contents): Fail if there are no section contents available when the compress_status is COMPRESS_SECTION_DONE. * libbfd.c (bfd_malloc): Refuse to allocate a negative size. (bfd_malloc2): Use bfd_malloc. (bfd_realloc): Refuse to reallocate a negative size. (bfd_realloc2): Use bfd_realloc. (bfd_realloc_or_free): Use bfd_realloc. (bfd_zmalloc): Use bfd_malloc. (bfd_zmalloc): Use bfd_malloc2. * opncls.c (bfd_alloc): Refuse to allocate a negative size.
This commit is contained in:
@ -2360,6 +2360,7 @@ free_debug_section (enum dwarf_section_display_enum debug)
|
||||
{
|
||||
sec->contents = NULL;
|
||||
sec->flags &= ~ SEC_IN_MEMORY;
|
||||
sec->compress_status = COMPRESS_SECTION_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user