diff options
author | nashe <thomas@chauchefoin.fr> | 2017-12-12 01:25:03 +0100 |
---|---|---|
committer | nashe <thomas@chauchefoin.fr> | 2017-12-12 01:25:03 +0100 |
commit | f43eb5adcfa3be6368f116656348a29f22f580eb (patch) | |
tree | f5fb6fb975f1b73b5dab62e154390d8b64032bd4 | |
parent | 522760fac79536eb68dc5fc70e9166f689eb76dc (diff) | |
download | redis-f43eb5adcfa3be6368f116656348a29f22f580eb.tar.gz |
Prevent off-by-one read in stringmatchlen() (fixes #4527)
-rw-r--r-- | src/util.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util.c b/src/util.c index 8d68f0bb1..36cbc43d3 100644 --- a/src/util.c +++ b/src/util.c @@ -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]) |