resolve-system-dependencies: Fix another segfault
runResolver() was barfing on directories like /System/Library/Frameworks/Security.framework/Versions/Current/PlugIns. It should probably do something sophisticated for frameworks, but let's ignore them for now.
This commit is contained in:
parent
acc889c821
commit
683a499ebb
|
@ -53,6 +53,11 @@ std::set<std::string> runResolver(const Path & filename)
|
||||||
if (fstat(fd.get(), &st))
|
if (fstat(fd.get(), &st))
|
||||||
throw SysError("statting ‘%s’", filename);
|
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)) {
|
if (st.st_size < sizeof(mach_header_64)) {
|
||||||
printError("file ‘%s’ is too short for a MACH binary", filename);
|
printError("file ‘%s’ is too short for a MACH binary", filename);
|
||||||
return {};
|
return {};
|
||||||
|
|
Loading…
Reference in a new issue