Prevent off-by-one read in stringmatchlen() (fixes #4527)

This commit is contained in:
nashe 2017-12-12 01:25:03 +01:00 committed by antirez
parent 733af14822
commit 8eeceabdc2

View File

@ -84,7 +84,7 @@ int stringmatchlen(const char *pattern, int patternLen,
}
match = 0;
while(1) {
if (pattern[0] == '\\') {
if (pattern[0] == '\\' && patternLen >= 2) {
pattern++;
patternLen--;
if (pattern[0] == string[0])