diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-16 07:14:32 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-16 07:14:32 +0000 |
commit | 7abafeb92d9ec90f152be98e2cc89981c337d4da (patch) | |
tree | 3f9dad2d0d094b9036247caac27fc68f532e0107 /test/ruby/test_io_m17n.rb | |
parent | 703a24a9478e83925e4275d126bb54848a72076b (diff) |
merge revision(s) 53083: [Backport #11823]
* io.c (parse_mode_enc): fix buffer overflow.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@53148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_io_m17n.rb')
-rw-r--r-- | test/ruby/test_io_m17n.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/ruby/test_io_m17n.rb b/test/ruby/test_io_m17n.rb index 5fbf056cd9..95081322d4 100644 --- a/test/ruby/test_io_m17n.rb +++ b/test/ruby/test_io_m17n.rb @@ -2073,6 +2073,19 @@ EOT } end + def test_bom_too_long_utfname + assert_separately([], <<-'end;') # do + assert_warn(/Unsupported encoding/) { + open(IO::NULL, "r:bom|utf-" + "x" * 10000) {} + } + end; + assert_separately([], <<-'end;') # do + assert_warn(/Unsupported encoding/) { + open(IO::NULL, encoding: "bom|utf-" + "x" * 10000) {} + } + end; + end + def test_cbuf with_tmpdir { fn = "tst" |