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 <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin
2018-06-08 18:39:48 +02:00

View File

@@ -760,7 +760,7 @@ static const char *setup_discovered_git_dir(const char *gitdir,
set_git_dir(gitdir);
inside_git_dir = 0;
inside_work_tree = 1;
if (offset == cwd->len)
if (offset >= cwd->len)
return NULL;
/* Make "offset" point past the '/' (already the case for root dirs) */