1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* test/ruby/test_io.rb: add test for IO.binread fd leak.

See r50881.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50882 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
eregon 2015-06-13 21:26:32 +00:00
parent 0ebf2afa81
commit 7151598d5b
2 changed files with 9 additions and 0 deletions

View file

@ -1,3 +1,8 @@
Sun Jun 14 06:24:57 2015 Benoit Daloze <eregontp@gmail.com>
* test/ruby/test_io.rb: add test for IO.binread fd leak.
See r50881.
Sun Jun 14 05:23:51 2015 Benoit Daloze <eregontp@gmail.com>
* io.c (rb_io_s_binread): close fd if seek offset is invalid.

View file

@ -2740,6 +2740,10 @@ End
end
end
def test_s_binread_does_not_leak_with_invalid_offset
assert_raise(Errno::EINVAL) { IO.binread(__FILE__, 0, -1) }
end
def test_s_binwrite
mkcdtmpdir do
path = "test_s_binwrite"