Skip to content

Commit 4470e48

Browse files
committed
workdir: validate working directory entry path length
1 parent 91156a0 commit 4470e48

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/filter.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -972,8 +972,10 @@ int git_filter_list_stream_file(
972972

973973
if ((error = stream_list_init(
974974
&stream_start, &filter_streams, filters, target)) < 0 ||
975-
(error = git_path_join_unrooted(&abspath, path, base, NULL)) < 0)
975+
(error = git_path_join_unrooted(&abspath, path, base, NULL)) < 0 ||
976+
(error = git_path_validate_workdir_buf(repo, &abspath)) < 0)
976977
goto done;
978+
977979
initialized = 1;
978980

979981
if ((fd = git_futils_open_ro(abspath.ptr)) < 0) {

0 commit comments

Comments
 (0)