summaryrefslogtreecommitdiff
path: root/compat
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2012-11-11 17:13:57 +0700
committerJunio C Hamano <gitster@pobox.com>2012-11-20 12:13:09 -0800
commitf10e3864dc3b0ba0051148f9b2b555df11fc337a (patch)
tree9b1a1fadcd268ecd0a7114d423a4451b652649a7 /compat
parent7e2010537e96d0a1144520222f20ba1dc3d61441 (diff)
downloadgit-f10e3864dc3b0ba0051148f9b2b555df11fc337a.tar.gz
compat/fnmatch: fix off-by-one character class's length check
Character class "xdigit" is the only one that hits 6 character limit defined by CHAR_CLASS_MAX_LENGTH. All other character classes are 5 character long and therefore never caught by this. This should make xdigit tests in t3070 pass on Windows. Reported-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'compat')
-rw-r--r--compat/fnmatch/fnmatch.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/compat/fnmatch/fnmatch.c b/compat/fnmatch/fnmatch.c
index 9473aed2bb..0ff1d273a5 100644
--- a/compat/fnmatch/fnmatch.c
+++ b/compat/fnmatch/fnmatch.c
@@ -345,7 +345,7 @@ internal_fnmatch (pattern, string, no_leading_period, flags)
for (;;)
{
- if (c1 == CHAR_CLASS_MAX_LENGTH)
+ if (c1 > CHAR_CLASS_MAX_LENGTH)
/* The name is too long and therefore the pattern
is ill-formed. */
return FNM_NOMATCH;