diff --git a/src/util.c b/src/util.c index 6a22d214..5981b78d 100644 --- a/src/util.c +++ b/src/util.c @@ -56,7 +56,7 @@ POSIX_ONLY(#include ) 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] == '*') {