diff options
Diffstat (limited to 'src/buildtool/execution_api/common')
-rw-r--r-- | src/buildtool/execution_api/common/tree_reader_utils.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/buildtool/execution_api/common/tree_reader_utils.cpp b/src/buildtool/execution_api/common/tree_reader_utils.cpp index 855c1842..13775201 100644 --- a/src/buildtool/execution_api/common/tree_reader_utils.cpp +++ b/src/buildtool/execution_api/common/tree_reader_utils.cpp @@ -106,6 +106,12 @@ auto TreeReaderUtils::ReadObjectInfos(bazel_re::Directory const& dir, } for (auto const& l : dir.symlinks()) { + // check validity of symlinks + if (not PathIsNonUpwards(l.target())) { + Logger::Log( + LogLevel::Error, "found invalid symlink at {}", l.name()); + return false; + } if (not store_info(l.name(), CreateObjectInfo(hash_function, l))) { return false; } |