From 4057ee5e8e054f3487a084d338f93cee9420c7eb Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 31 Jan 2018 08:17:16 +0000 Subject: io.c: fptr_copy_finalizer * io.c (fptr_copy_finalizer): remove fptr from pipe_list when pipe became ordinary file, to fix access after free. to be finalized by pipe_finalize and being in pipe_list must match. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_process.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test/ruby') diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index 5d85ca3a18..0d2bc50b2d 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -1814,8 +1814,9 @@ class TestProcess < Test::Unit::TestCase assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}") begin; io = File.open(IO::NULL) + io2 = io.dup IO.popen("echo") {|f| io.reopen(f)} - io.reopen(io.dup) + io.reopen(io2) end; end -- cgit v1.2.3