git.99rst.org
/
git.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
| inline |
side by side
(parent:
5fa0f52
)
mingw: avoid a buffer overrun in `needs_hiding()`
author
Johannes Schindelin
<redacted>
Fri, 25 Oct 2019 14:13:36 +0000
(14:13 +0000)
committer
Junio C Hamano
<redacted>
Mon, 28 Oct 2019 03:38:51 +0000
(12:38 +0900)
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 <redacted>
Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Junio C Hamano <redacted>
compat/mingw.c
patch
|
blob
|
history
diff --git
a/compat/mingw.c
b/compat/mingw.c
index 738f0a826a51b850fcc93f0cadbf707c7eb0b492..f76ba3d750c806711c2291fabf2d81e18b8ca259 100644
(file)
--- 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)
git clone https://git.99rst.org/PROJECT