Fixed rare worst-case out-of-bounds access in extmatch algorithm
This commit is contained in:
parent
9896377a47
commit
352123b2d5
1 changed files with 1 additions and 1 deletions
|
@ -271,7 +271,7 @@ static inline size_t max_length(size_t len) {
|
|||
}
|
||||
|
||||
int extmatch(const char *pattern, const char *string, const char **errmsg) {
|
||||
char regex[max_length(strlen(pattern))];
|
||||
char regex[max_length(strlen(pattern)) + 1];
|
||||
if (transform(pattern, regex, errmsg) != -1) {
|
||||
int erroffset;
|
||||
pcre *preg = pcre_compile(regex, 0, errmsg, &erroffset, NULL);
|
||||
|
|
Loading…
Add table
Reference in a new issue