diff options
Diffstat (limited to 'regex.c')
-rw-r--r-- | regex.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -2373,9 +2373,10 @@ re_compile_pattern(pattern, size, bufp) nextp = p + mbclen(c) - 1; if (!pending_exact || pending_exact + *pending_exact + 1 != b || *pending_exact >= (c1 ? 0176 : 0177) - || *nextp == '+' || *nextp == '?' - || *nextp == '*' || *nextp == '^' - || *nextp == '{') { + || (nextp < pend && + ( *nextp == '+' || *nextp == '?' + || *nextp == '*' || *nextp == '^' + || *nextp == '{'))) { laststart = b; BUFPUSH(exactn); pending_exact = b; |