From 999d9d2bd44349343f933d308e9debb9138b5f2a Mon Sep 17 00:00:00 2001 From: Alexander Kabaev Date: Fri, 29 Nov 2002 16:41:31 +0000 Subject: [PATCH] Put back a test for binaries with no PT_LOAD entries I over-jealosly removed in r1.69. Apploved by: re (rwatson) --- libexec/rtld-elf/rtld.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 24472027c75..3ad6017cb7d 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -712,6 +712,10 @@ digest_phdr(const Elf_Phdr *phdr, int phnum, caddr_t entry, const char *path) break; } } + if (nsegs < 1) { + _rtld_error("%s: too few PT_LOAD segments", path); + return NULL; + } obj->entry = entry; return obj;