]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'js/mingw-needs-hiding-fix'
authorJunio C Hamano <gitster@pobox.com>
Wed, 30 Oct 2019 06:13:13 +0000 (15:13 +0900)
committerJunio C Hamano <gitster@pobox.com>
Wed, 30 Oct 2019 06:13:13 +0000 (15:13 +0900)
Fix for a (rather old) buffer-overrun bug.

* js/mingw-needs-hiding-fix:
  mingw: avoid a buffer overrun in `needs_hiding()`

compat/mingw.c

index 6b765d936cfc8afe198b2735dafd4116c1706b58..fe609239dd6ba22a843b243647868f887014d40e 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)