mirror of
https://github.com/redis/redis.git
synced 2026-04-21 03:01:35 -04:00
Prevent off-by-one read in stringmatchlen() (fixes #4527)
This commit is contained in:
@@ -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])
|
||||
|
||||
Reference in New Issue
Block a user