From c710d4afdccc0c797745bc3264f3f32a4cdd85da 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 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] == '*') {