mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-17 16:05:56 +08:00
Fix memory access violations exposed by running the srconv tool on fuzzed binaries.
PR binutils/17512 * objdump.c (display_any_bfd): Add a depth limit to nested archive display in order to avoid infinite loops. * srconv.c: Replace calls to abort with calls to fatal with an error message.
This commit is contained in:
@ -3406,9 +3406,16 @@ display_any_bfd (bfd *file, int level)
|
||||
{
|
||||
bfd *arfile = NULL;
|
||||
bfd *last_arfile = NULL;
|
||||
|
||||
|
||||
if (level == 0)
|
||||
printf (_("In archive %s:\n"), bfd_get_filename (file));
|
||||
else if (level > 100)
|
||||
{
|
||||
/* Prevent corrupted files from spinning us into an
|
||||
infinite loop. 100 is an arbitrary heuristic. */
|
||||
non_fatal (_("Archive nesting is too deep"));
|
||||
return;
|
||||
}
|
||||
else
|
||||
printf (_("In nested archive %s:\n"), bfd_get_filename (file));
|
||||
|
||||
|
Reference in New Issue
Block a user