summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ldso/util/ldd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ldso/util/ldd.c b/ldso/util/ldd.c
index defc91cfd..661fb865f 100644
--- a/ldso/util/ldd.c
+++ b/ldso/util/ldd.c
@@ -503,6 +503,9 @@ int find_dependancies(char* filename)
if ((size_t)statbuf.st_size < sizeof(Elf32_Ehdr))
goto foo;
+ if (!S_ISREG(statbuf.st_mode))
+ goto foo;
+
/* mmap the file to make reading stuff from it effortless */
ehdr = (Elf32_Ehdr *)mmap(0, statbuf.st_size,
PROT_READ|PROT_WRITE, MAP_PRIVATE, fileno(thefile), 0);