mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
* regcomp.c (set_bm_skip): Need to check the end of the string.
this patch is from e5c0e6c361
. [Backport #12997]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e6e4d2e158
commit
945c600a6d
2 changed files with 9 additions and 1 deletions
|
@ -4192,6 +4192,8 @@ set_bm_skip(UChar* s, UChar* end, regex_t* reg,
|
|||
n = ONIGENC_GET_CASE_FOLD_CODES_BY_STR(enc, reg->case_fold_flag,
|
||||
p, end, items);
|
||||
clen = enclen(enc, p, end);
|
||||
if (p + clen > end)
|
||||
clen = (int )(end - p);
|
||||
|
||||
for (j = 0; j < n; j++) {
|
||||
if ((items[j].code_len != 1) || (items[j].byte_len != clen))
|
||||
|
@ -4222,6 +4224,8 @@ set_bm_skip(UChar* s, UChar* end, regex_t* reg,
|
|||
n = ONIGENC_GET_CASE_FOLD_CODES_BY_STR(enc, reg->case_fold_flag,
|
||||
p, end, items);
|
||||
clen = enclen(enc, p, end);
|
||||
if (p + clen > end)
|
||||
clen = (int )(end - p);
|
||||
|
||||
for (j = 0; j < n; j++) {
|
||||
if ((items[j].code_len != 1) || (items[j].byte_len != clen))
|
||||
|
@ -4265,6 +4269,8 @@ set_bm_skip(UChar* s, UChar* end, regex_t* reg,
|
|||
n = ONIGENC_GET_CASE_FOLD_CODES_BY_STR(enc, reg->case_fold_flag,
|
||||
p, end, items);
|
||||
clen = enclen(enc, p, end);
|
||||
if (p + clen > end)
|
||||
clen = (int )(end - p);
|
||||
|
||||
for (j = 0; j < n; j++) {
|
||||
if ((items[j].code_len != 1) || (items[j].byte_len != clen))
|
||||
|
@ -4295,6 +4301,8 @@ set_bm_skip(UChar* s, UChar* end, regex_t* reg,
|
|||
n = ONIGENC_GET_CASE_FOLD_CODES_BY_STR(enc, reg->case_fold_flag,
|
||||
p, end, items);
|
||||
clen = enclen(enc, p, end);
|
||||
if (p + clen > end)
|
||||
clen = (int )(end - p);
|
||||
|
||||
for (j = 0; j < n; j++) {
|
||||
if ((items[j].code_len != 1) || (items[j].byte_len != clen))
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#define RUBY_VERSION "2.3.4"
|
||||
#define RUBY_RELEASE_DATE "2017-03-28"
|
||||
#define RUBY_PATCHLEVEL 297
|
||||
#define RUBY_PATCHLEVEL 298
|
||||
|
||||
#define RUBY_RELEASE_YEAR 2017
|
||||
#define RUBY_RELEASE_MONTH 3
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue