diff --git a/smex/elf.c b/smex/elf.c index 6cee085db..53125c1d7 100644 --- a/smex/elf.c +++ b/smex/elf.c @@ -387,6 +387,11 @@ int elf_find_section(const struct elf_module *module, const char *name) size_t count; int ret, i; + if (module->section == NULL) { + fprintf(stderr, "error: NULL module section\n"); + return -EINVAL; + } + section = &module->section[hdr->shstrndx]; /* alloc data data */