diff options
| author | Edward Thomson <ethomson@edwardthomson.com> | 2021-04-04 19:46:08 +0100 |
|---|---|---|
| committer | Edward Thomson <ethomson@edwardthomson.com> | 2021-04-28 13:03:34 +0100 |
| commit | e52c2989fb6911ef74cccd87a57bffd884842d36 (patch) | |
| tree | dbdad96025e910de9ad31f7294773ced49bc1095 | |
| parent | 4470e48a7dc5447952188db2bea7e6f141082343 (diff) | |
| download | libgit2-e52c2989fb6911ef74cccd87a57bffd884842d36.tar.gz | |
repository: validate workdir path lengths
| -rw-r--r-- | src/repository.c | 6 |
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) |
