aboutsummaryrefslogtreecommitdiff
path: root/lib/glob.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/glob.c')
-rw-r--r--lib/glob.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/glob.c b/lib/glob.c
index 15b73f490720..aa57900d2062 100644
--- a/lib/glob.c
+++ b/lib/glob.c
@@ -68,6 +68,8 @@ bool __pure glob_match(char const *pat, char const *str)
back_str = --str; /* Allow zero-length match */
break;
case '[': { /* Character class */
+ if (c == '\0') /* No possible match */
+ return false;
bool match = false, inverted = (*pat == '!');
char const *class = pat + inverted;
unsigned char a = *class++;