From 8148b7013c1b08df4fb7bd87bfc699f1f929e540 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 2 Oct 2017 06:46:42 +0000 Subject: io.c: check null char * io.c (ruby_set_inplace_mode): check if null is contained. based on the patch by tommy (Masahiro Tomita) in [ruby-dev:50272]. [Bug #13960] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_argf.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/ruby/test_argf.rb') diff --git a/test/ruby/test_argf.rb b/test/ruby/test_argf.rb index bc5c67d0d8..a112cf3e84 100644 --- a/test/ruby/test_argf.rb +++ b/test/ruby/test_argf.rb @@ -310,6 +310,12 @@ class TestArgf < Test::Unit::TestCase }; end + def test_inplace_invalid_backup + assert_raise(ArgumentError, '[ruby-dev:50272] [Bug #13960]') { + ARGF.inplace_mode = "a\0" + } + end + def test_encoding ruby('-e', "#{<<~"{#"}\n#{<<~'};'}", @t1.path, @t2.path, @t3.path) do |f| {# -- cgit v1.2.3