From c30b9dc868a47b595a20f2401b168035fe220ae2 Mon Sep 17 00:00:00 2001 From: antirez Date: Tue, 11 Dec 2018 13:18:52 +0100 Subject: [PATCH] Fix stringmatchlen() read past buffer bug. See #5632. --- src/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.c b/src/util.c index 430cbe61a..1dc8dd871 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] == '*') {