summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2021-04-04 19:46:08 +0100
committerEdward Thomson <ethomson@edwardthomson.com>2021-04-28 13:03:34 +0100
commite52c2989fb6911ef74cccd87a57bffd884842d36 (patch)
treedbdad96025e910de9ad31f7294773ced49bc1095
parent4470e48a7dc5447952188db2bea7e6f141082343 (diff)
downloadlibgit2-e52c2989fb6911ef74cccd87a57bffd884842d36.tar.gz
repository: validate workdir path lengths
-rw-r--r--src/repository.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/repository.c b/src/repository.c
index c243f1d7d..3544fa929 100644
--- a/src/repository.c
+++ b/src/repository.c
@@ -2702,9 +2702,9 @@ int git_repository_hashfile(
* now that is not possible because git_filters_load() needs it.
*/
- error = git_path_join_unrooted(
- &full_path, path, git_repository_workdir(repo), NULL);
- if (error < 0)
+ if ((error = git_path_join_unrooted(
+ &full_path, path, git_repository_workdir(repo), NULL)) < 0 ||
+ (error = git_path_validate_workdir_buf(repo, &full_path)) < 0)
return error;
if (!as_path)