Skip to content

Commit bf6873a

Browse files
kkoscmb69
authored andcommitted
Fix out-of-bounds write
Fixes CVE-2020-26159. Backported from <kkos/oniguruma@cbe9f8b>.
1 parent 1666cfc commit bf6873a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/mbstring/oniguruma/src/regcomp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5603,7 +5603,7 @@ concat_opt_exact_str(OptStr* to, UChar* s, UChar* end, OnigEncoding enc)
56035603

56045604
for (i = to->len, p = s; p < end && i < OPT_EXACT_MAXLEN; ) {
56055605
len = enclen(enc, p);
5606-
if (i + len > OPT_EXACT_MAXLEN) break;
5606+
if (i + len >= OPT_EXACT_MAXLEN) break;
56075607
for (j = 0; j < len && p < end; j++)
56085608
to->s[i++] = *p++;
56095609
}

0 commit comments

Comments
 (0)