зеркало из https://github.com/github/ruby.git
merge revision(s) 75aaeb35b82da26359b9418d2963384d0c55839c: [Backport #20239]
[Bug #20239] Fix overflow at down-casting
This commit is contained in:
Родитель
9d583dd43a
Коммит
df8a08fb6a
2
regenc.c
2
regenc.c
|
@ -57,7 +57,7 @@ onigenc_mbclen(const OnigUChar* p,const OnigUChar* e, OnigEncoding enc)
|
|||
int ret = ONIGENC_PRECISE_MBC_ENC_LEN(enc, p, e);
|
||||
if (ONIGENC_MBCLEN_CHARFOUND_P(ret)) {
|
||||
ret = ONIGENC_MBCLEN_CHARFOUND_LEN(ret);
|
||||
if (ret > (int)(e - p)) ret = (int)(e - p); // just for case
|
||||
if (p + ret > e) ret = (int)(e - p); // just for case
|
||||
return ret;
|
||||
}
|
||||
else if (ONIGENC_MBCLEN_NEEDMORE_P(ret)) {
|
||||
|
|
|
@ -3534,7 +3534,7 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
|
|||
n = pend - pstart;
|
||||
DATA_ENSURE(n);
|
||||
sprev = s;
|
||||
STRING_CMP_IC(case_fold_flag, pstart, &s, (int)n, end);
|
||||
STRING_CMP_IC(case_fold_flag, pstart, &s, n, end);
|
||||
while (sprev + (len = enclen_approx(encode, sprev, end)) < s)
|
||||
sprev += len;
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
# define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR
|
||||
#define RUBY_VERSION_TEENY 3
|
||||
#define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR
|
||||
#define RUBY_PATCHLEVEL 92
|
||||
#define RUBY_PATCHLEVEL 93
|
||||
|
||||
#include "ruby/version.h"
|
||||
#include "ruby/internal/abi.h"
|
||||
|
|
Загрузка…
Ссылка в новой задаче