]> git.ipfire.org Git - thirdparty/git.git/blobdiff - compat/mingw.c
mingw: avoid a buffer overrun in `needs_hiding()`
[thirdparty/git.git] / compat / mingw.c
index 738f0a826a51b850fcc93f0cadbf707c7eb0b492..f76ba3d750c806711c2291fabf2d81e18b8ca259 100644 (file)
@@ -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)