From 0a967ec280d27a084fb6583090dda9ebe3bbaf03 Mon Sep 17 00:00:00 2001 From: Israel Lot Date: Tue, 12 Mar 2019 18:08:01 -0500 Subject: [PATCH] Fix stringmatchlen() read past buffer bug --- src/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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] == '*') {