From 091bd738d79d5485936578ed2cb7edb96efbc80f Mon Sep 17 00:00:00 2001 From: Edward Thomson Date: Fri, 24 Sep 2021 17:00:43 -0400 Subject: attr: ensure lookups are on repo-relative paths Attribute lookups are done on paths relative to the repository. Fail if erroneously presented with an absolute path. --- src/attr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/attr.c b/src/attr.c index 14eab5b46..cd704a490 100644 --- a/src/attr.c +++ b/src/attr.c @@ -629,6 +629,8 @@ static int collect_attr_files( const char *workdir = git_repository_workdir(repo); attr_walk_up_info info = { NULL }; + GIT_ASSERT(!git_path_is_absolute(path)); + if ((error = attr_setup(repo, attr_session, opts)) < 0) return error; -- cgit v1.2.1