diff --git a/src/util.c b/src/util.c index 430cbe61..1dc8dd87 100644 --- a/src/util.c +++ b/src/util.c @@ -48,7 +48,7 @@ int stringmatchlen(const char *pattern, int patternLen, const char *string, int stringLen, int nocase) { - while(patternLen) { + while(patternLen && stringLen) { switch(pattern[0]) { case '*': while (pattern[1] == '*') {