summaryrefslogtreecommitdiffstats
path: root/src/unstrip.c
diff options
context:
space:
mode:
authorMark Wielaard <[email protected]>2018-11-02 23:17:05 +0100
committerMark Wielaard <[email protected]>2018-11-02 23:17:05 +0100
commite574889d92b123a2e62aa2f32bab00af86bfe5fd (patch)
tree6dddaf79dac59ba3c3da3ff19936c77dbdb5f906 /src/unstrip.c
parent5199e15870e05e5b0b9f98c20fc9b5427aa6dd6a (diff)
unstrip: Add ELF_CHECK to make sure gelf_getehdr () doesn't return NULL.
Signed-off-by: Mark Wielaard <[email protected]>
Diffstat (limited to 'src/unstrip.c')
-rw-r--r--src/unstrip.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/unstrip.c b/src/unstrip.c
index 32da89d7..3495b1d9 100644
--- a/src/unstrip.c
+++ b/src/unstrip.c
@@ -245,6 +245,7 @@ copy_elf (Elf *outelf, Elf *inelf)
GElf_Ehdr ehdr_mem;
GElf_Ehdr *ehdr = gelf_getehdr (inelf, &ehdr_mem);
+ ELF_CHECK (ehdr != NULL, _("cannot get ELF header: %s"));
if (shstrndx < SHN_LORESERVE)
ehdr->e_shstrndx = shstrndx;
else