Skip to content

Commit df8a08f

Browse files
committed
merge revision(s) 75aaeb3: [Backport #20239]
[Bug #20239] Fix overflow at down-casting
1 parent 9d583dd commit df8a08f

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

regenc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ onigenc_mbclen(const OnigUChar* p,const OnigUChar* e, OnigEncoding enc)
5757
int ret = ONIGENC_PRECISE_MBC_ENC_LEN(enc, p, e);
5858
if (ONIGENC_MBCLEN_CHARFOUND_P(ret)) {
5959
ret = ONIGENC_MBCLEN_CHARFOUND_LEN(ret);
60-
if (ret > (int)(e - p)) ret = (int)(e - p); // just for case
60+
if (p + ret > e) ret = (int)(e - p); // just for case
6161
return ret;
6262
}
6363
else if (ONIGENC_MBCLEN_NEEDMORE_P(ret)) {

regexec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3534,7 +3534,7 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
35343534
n = pend - pstart;
35353535
DATA_ENSURE(n);
35363536
sprev = s;
3537-
STRING_CMP_IC(case_fold_flag, pstart, &s, (int)n, end);
3537+
STRING_CMP_IC(case_fold_flag, pstart, &s, n, end);
35383538
while (sprev + (len = enclen_approx(encode, sprev, end)) < s)
35393539
sprev += len;
35403540

version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR
1212
#define RUBY_VERSION_TEENY 3
1313
#define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR
14-
#define RUBY_PATCHLEVEL 92
14+
#define RUBY_PATCHLEVEL 93
1515

1616
#include "ruby/version.h"
1717
#include "ruby/internal/abi.h"

0 commit comments

Comments
 (0)