mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-10-12 10:28:59 +08:00
* elfcode.h (elf_slurp_symbol_table): Test elf_elfsections for NULL,
as can happen with a core file, before dereferencing.
This commit is contained in:
@ -1150,7 +1150,8 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic)
|
||||
|
||||
/* If we have a SHT_SYMTAB_SHNDX section for the symbol table,
|
||||
read the raw contents. */
|
||||
if (elf_elfsections (abfd)[shndx_hdr->sh_link] == hdr)
|
||||
if (elf_elfsections (abfd) != NULL
|
||||
&& elf_elfsections (abfd)[shndx_hdr->sh_link] == hdr)
|
||||
{
|
||||
amt = shndx_hdr->sh_size;
|
||||
x_shndx = (Elf_External_Sym_Shndx *) bfd_malloc (amt);
|
||||
|
Reference in New Issue
Block a user