Skip to content

Commit 03fcbe8

Browse files
committed
Merge branch 'fix-unc-buffer-overflow'
This fixes `git status` in a Git worktree at the top of a file share. Signed-off-by: Johannes Schindelin <[email protected]>
2 parents 64bf490 + 0ea9243 commit 03fcbe8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

setup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ static const char *setup_discovered_git_dir(const char *gitdir,
763763
set_git_dir(gitdir);
764764
inside_git_dir = 0;
765765
inside_work_tree = 1;
766-
if (offset == cwd->len)
766+
if (offset >= cwd->len)
767767
return NULL;
768768

769769
/* Make "offset" point past the '/' (already the case for root dirs) */

0 commit comments

Comments
 (0)