about summary refs log tree commit diff
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 61504298608b..b04595732b92 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 {};