From a8b50ad395b72c6933c164d064d86d60cd6b594c Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Fri, 10 Jan 2025 15:19:21 +0100 Subject: just-mr setup: Fix ensuring field 'subdir' only accepts relative paths --- src/other_tools/utils/parse_archive.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/other_tools/utils/parse_archive.cpp') diff --git a/src/other_tools/utils/parse_archive.cpp b/src/other_tools/utils/parse_archive.cpp index b07bc425..50b9d4a3 100644 --- a/src/other_tools/utils/parse_archive.cpp +++ b/src/other_tools/utils/parse_archive.cpp @@ -129,6 +129,13 @@ auto ParseArchiveDescription(ExpressionPtr const& repo_desc, ? repo_desc_subdir->String() : "") .lexically_normal(); + if (subdir.is_absolute()) { + (*logger)(fmt::format("ArchiveCheckout: Expected field \"subdir\" to " + "be a relative path, but found {}", + subdir.string()), + /*fatal=*/true); + return std::nullopt; + } // check "special" pragma auto repo_desc_pragma = repo_desc->At("pragma"); -- cgit v1.2.3