mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 17:10:50 +00:00
Merge pull request #4528 from nashe/patch-oob-read-4527
Prevent off-by-one read in stringmatchlen()
This commit is contained in:
commit
398b2084af
@ -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