From 7abafeb92d9ec90f152be98e2cc89981c337d4da Mon Sep 17 00:00:00 2001 From: usa Date: Wed, 16 Dec 2015 07:14:32 +0000 Subject: 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 --- test/ruby/test_io_m17n.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test/ruby') 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" -- cgit v1.2.3