Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2019-10-25 17:13:36 +0300
committerJunio C Hamano <gitster@pobox.com>2019-10-28 06:38:51 +0300
commit60e6569a1207d75a351684e2c48f8d18d15a0032 (patch)
treefab1f1f9aff26cdc1522c9837a51eab82815ba1f /compat/mingw.c
parent5fa0f5238b0cd46cfe7f6fa76c3f526ea98148d9 (diff)
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>
Diffstat (limited to 'compat/mingw.c')
-rw-r--r--compat/mingw.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/compat/mingw.c b/compat/mingw.c
index 738f0a826a..f76ba3d750 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -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)