mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-05 15:15:42 +00:00
objdump segfault after symbol table error
This memcpy segfaults if symcount is -1 (=> syms is NULL).
memcpy (sorted_syms, symcount ? syms : dynsyms,
sorted_symcount * sizeof (asymbol *));
* objdump.c (slurp_symtab): Don't leave symcount as -1 after
an error.
(slurp_dynamic_symtab): Likewise for dynsymcount.
This commit is contained in:
@@ -1015,6 +1015,7 @@ slurp_symtab (bfd *abfd)
|
||||
my_bfd_nonfatal (bfd_get_filename (abfd));
|
||||
free (sy);
|
||||
sy = NULL;
|
||||
symcount = 0;
|
||||
}
|
||||
return sy;
|
||||
}
|
||||
@@ -1048,6 +1049,7 @@ slurp_dynamic_symtab (bfd *abfd)
|
||||
my_bfd_nonfatal (bfd_get_filename (abfd));
|
||||
free (sy);
|
||||
sy = NULL;
|
||||
dynsymcount = 0;
|
||||
}
|
||||
return sy;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user