Commit 7602f695 authored by antirez's avatar antirez
Browse files

Fix stringmatchlen() read past buffer bug.

See #5632.
parent c4f3585e
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
int stringmatchlen(const char *pattern, int patternLen, int stringmatchlen(const char *pattern, int patternLen,
const char *string, int stringLen, int nocase) const char *string, int stringLen, int nocase)
{ {
while(patternLen) { while(patternLen && stringLen) {
switch(pattern[0]) { switch(pattern[0]) {
case '*': case '*':
while (pattern[1] == '*') { while (pattern[1] == '*') {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment