From 1d5847d1af2d9422a7d10963ee8819d41ca046bf Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 31 Jan 2018 04:24:57 +0000 Subject: io.c: pipe_register_fptr * io.c (pipe_register_fptr): get rid of double registration which causes access after free and segfault. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_process.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index 57bfd78f7c..5d85ca3a18 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -1810,6 +1810,15 @@ class TestProcess < Test::Unit::TestCase end end + def test_popen_reopen + assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}") + begin; + io = File.open(IO::NULL) + IO.popen("echo") {|f| io.reopen(f)} + io.reopen(io.dup) + end; + end + def test_execopts_new_pgroup return unless windows? -- cgit v1.2.3