mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 09:00:51 +00:00
Prevent off-by-one read in stringmatchlen() (fixes #4527)
This commit is contained in:
parent
522760fac7
commit
f43eb5adcf
@ -84,7 +84,7 @@ int stringmatchlen(const char *pattern, int patternLen,
|
|||||||
}
|
}
|
||||||
match = 0;
|
match = 0;
|
||||||
while(1) {
|
while(1) {
|
||||||
if (pattern[0] == '\\') {
|
if (pattern[0] == '\\' && patternLen >= 2) {
|
||||||
pattern++;
|
pattern++;
|
||||||
patternLen--;
|
patternLen--;
|
||||||
if (pattern[0] == string[0])
|
if (pattern[0] == string[0])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user