Skip to content

Commit e52c298

Browse files
committed
repository: validate workdir path lengths
1 parent 4470e48 commit e52c298

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/repository.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2702,9 +2702,9 @@ int git_repository_hashfile(
27022702
* now that is not possible because git_filters_load() needs it.
27032703
*/
27042704

2705-
error = git_path_join_unrooted(
2706-
&full_path, path, git_repository_workdir(repo), NULL);
2707-
if (error < 0)
2705+
if ((error = git_path_join_unrooted(
2706+
&full_path, path, git_repository_workdir(repo), NULL)) < 0 ||
2707+
(error = git_path_validate_workdir_buf(repo, &full_path)) < 0)
27082708
return error;
27092709

27102710
if (!as_path)

0 commit comments

Comments
 (0)