summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-31 04:24:57 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-31 04:24:57 +0000
commit1d5847d1af2d9422a7d10963ee8819d41ca046bf (patch)
treed0d8b9bc5231f58ee74f284baafcf51dec1f3208 /test/ruby
parent80d74ea732b31f0a5eba5e2569f832388a95c0f4 (diff)
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
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_process.rb9
1 files changed, 9 insertions, 0 deletions
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?