diff options
-rw-r--r-- | src/readelf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/readelf.c b/src/readelf.c index 6950204e..4a1b985d 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -1606,7 +1606,7 @@ static const char * section_name (Ebl *ebl, GElf_Shdr *shdr) { size_t shstrndx; - if (elf_getshdrstrndx (ebl->elf, &shstrndx) < 0) + if (shdr == NULL || elf_getshdrstrndx (ebl->elf, &shstrndx) < 0) return "???"; return elf_strptr (ebl->elf, shstrndx, shdr->sh_name) ?: "???"; } |