Skip to content

Commit

Permalink
#221: revert cbe9f8b and 8155473: Out-of-bounds write in #207 (Issues…
Browse files Browse the repository at this point in the history
… found with Coverity) is fake
  • Loading branch information
kkos committed Oct 20, 2020
1 parent cbdbdad commit 3603d78
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/regcomp.c
Original file line number Diff line number Diff line change
Expand Up @@ -6238,7 +6238,7 @@ concat_opt_exact(OptStr* to, OptStr* add, OnigEncoding enc)
end = p + add->len;
for (i = to->len; p < end; ) {
len = enclen(enc, p);
if (i + len >= OPT_EXACT_MAXLEN) {
if (i + len > OPT_EXACT_MAXLEN) {
r = 1; /* 1:full */
break;
}
Expand All @@ -6264,7 +6264,7 @@ concat_opt_exact_str(OptStr* to, UChar* s, UChar* end, OnigEncoding enc)

for (i = to->len, p = s; p < end && i < OPT_EXACT_MAXLEN; ) {
len = enclen(enc, p);
if (i + len >= OPT_EXACT_MAXLEN) break;
if (i + len > OPT_EXACT_MAXLEN) break;
for (j = 0; j < len && p < end; j++)
to->s[i++] = *p++;
}
Expand Down

0 comments on commit 3603d78

Please sign in to comment.