aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/resolve-system-dependencies/resolve-system-dependencies.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/resolve-system-dependencies/resolve-system-dependencies.cc b/src/resolve-system-dependencies/resolve-system-dependencies.cc
index 615042986..b04595732 100644
--- a/src/resolve-system-dependencies/resolve-system-dependencies.cc
+++ b/src/resolve-system-dependencies/resolve-system-dependencies.cc
@@ -53,6 +53,11 @@ std::set<std::string> runResolver(const Path & filename)
if (fstat(fd.get(), &st))
throw SysError("statting ‘%s’", filename);
+ if (!S_ISREG(st.st_mode)) {
+ printError("file ‘%s’ is not a regular file", filename);
+ return {};
+ }
+
if (st.st_size < sizeof(mach_header_64)) {
printError("file ‘%s’ is too short for a MACH binary", filename);
return {};