mirror of
https://github.com/git/git
synced 2024-08-25 02:35:46 +00:00
mingw: avoid a buffer overrun in needs_hiding()
When this function is passed a path with a trailing slash, it runs right over the end of that path. Let's fix this. Co-authored-by: Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
5fa0f5238b
commit
60e6569a12
|
@ -363,6 +363,8 @@ static inline int needs_hiding(const char *path)
|
|||
/* ignore trailing slashes */
|
||||
if (*path)
|
||||
basename = path;
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
if (hide_dotfiles == HIDE_DOTFILES_TRUE)
|
||||
|
|
Loading…
Reference in a new issue