summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/elf.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/common/elf.c b/common/elf.c
index 0e92661e1a..bd97858c89 100644
--- a/common/elf.c
+++ b/common/elf.c
@@ -119,6 +119,11 @@ static int elf_check_image(struct elf_image *elf)
return -ENOEXEC;
}
+ if (!elf_hdr_e_phnum(elf, elf->buf)) {
+ pr_err("No phdr found.\n");
+ return -ENOEXEC;
+ }
+
return 0;
}