summaryrefslogtreecommitdiff
path: root/bfd/elfcode.h
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2001-12-19 23:54:26 +0000
committerAlan Modra <amodra@bigpond.net.au>2001-12-19 23:54:26 +0000
commit5c384f9c34bd75a920ef324eff1204de0b8ee6b4 (patch)
treebfa3738548a84d7c2d4793d8a068816eb2443be6 /bfd/elfcode.h
parent103f16c611151bbfa09897594f60a4a76389810a (diff)
downloadbinutils-redhat-5c384f9c34bd75a920ef324eff1204de0b8ee6b4.tar.gz
* elfcode.h (elf_slurp_symbol_table): Test elf_elfsections for NULL,
as can happen with a core file, before dereferencing.
Diffstat (limited to 'bfd/elfcode.h')
-rw-r--r--bfd/elfcode.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/bfd/elfcode.h b/bfd/elfcode.h
index 204756c745..203323cdb5 100644
--- a/bfd/elfcode.h
+++ b/bfd/elfcode.h
@@ -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);