1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

merge revision(s) 52016,52017,52019,52020,52021: [Backport #10735]

* enc/euc_jp.c (mbc_case_fold): check given string is valid or not,
	  and if invalid, return 1. [Bug #11486]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@52652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nagachika 2015-11-18 15:49:29 +00:00
parent bd210ff164
commit 478cdf49d7
4 changed files with 13 additions and 1 deletions

View file

@ -1,3 +1,8 @@
Thu Nov 19 00:41:09 2015 NARUSE, Yui <naruse@ruby-lang.org>
* enc/euc_jp.c (mbc_case_fold): check given string is valid or not,
and if invalid, return 1. [Bug #11486]
Thu Nov 19 00:15:23 2015 Zachary Scott <zzak@ruby-lang.org>
* ext/openssl/ossl_pkey.c: Merge ruby/openssl@b9ea8ef [Bug #10735]

View file

@ -381,8 +381,10 @@ mbc_case_fold(OnigCaseFoldType flag,
OnigCodePoint code;
int len;
len = mbc_enc_len(p, end, enc);
code = get_lower_case(mbc_to_code(p, end, enc));
len = code_to_mbc(code, lower, enc);
if (len == ONIGERR_INVALID_CODE_POINT_VALUE) len = 1;
(*pp) += len;
return len; /* return byte length of converted char to lower */
}

View file

@ -1635,4 +1635,9 @@ class TestM17NComb < Test::Unit::TestCase
}
end
def test_bug11486
bug11486 = '[Bug #11486]'
assert_nil ("\u3042"*19+"\r"*19+"\u3042"*20+"\r"*20).encode(Encoding::EUC_JP).gsub!(/xxx/i, ""), bug11486
assert_match Regexp.new("ABC\uff41".encode(Encoding::EUC_JP), Regexp::IGNORECASE), "abc\uFF21".encode(Encoding::EUC_JP), bug11486
end
end

View file

@ -1,6 +1,6 @@
#define RUBY_VERSION "2.2.4"
#define RUBY_RELEASE_DATE "2015-11-19"
#define RUBY_PATCHLEVEL 190
#define RUBY_PATCHLEVEL 191
#define RUBY_RELEASE_YEAR 2015
#define RUBY_RELEASE_MONTH 11