Commit f43eb5ad authored by nashe's avatar nashe
Browse files

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

parent 522760fa
...@@ -84,7 +84,7 @@ int stringmatchlen(const char *pattern, int patternLen, ...@@ -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])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment