mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-19 00:59:15 +08:00
More fixes for memory access violations triggered by fuzzed binaries.
PR binutils/17512 * objdump.c (display_any_bfd): Avoid infinite loop closing and opening the same archive again and again. * archive64.c (bfd_elf64_archive_slurp_armap): Add range checks. * libbfd.c (safe_read_leb128): New function. * libbfd-in.h (safe_read_leb128): Add prototype. * libbfd.h: Regenerate. * elf-attrs.c (_bfd_elf_parse_attributes): Use safe_read_leb128. Check for an over-long subsection length. * elf.c (elf_parse_notes): Check that the namedata is long enough for the string comparison that is about to be performed. (elf_read_notes): Zero-terminate the note buffer.
This commit is contained in:
@ -3426,7 +3426,15 @@ display_any_bfd (bfd *file, int level)
|
||||
display_any_bfd (arfile, level + 1);
|
||||
|
||||
if (last_arfile != NULL)
|
||||
bfd_close (last_arfile);
|
||||
{
|
||||
bfd_close (last_arfile);
|
||||
/* PR 17512: file: ac585d01. */
|
||||
if (arfile == last_arfile)
|
||||
{
|
||||
last_arfile = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
last_arfile = arfile;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user