summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-13 21:26:32 +0000
committereregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-13 21:26:32 +0000
commit7151598d5b2bc8a36995380be814a3183e4461c6 (patch)
tree0c81ef5a62f99b0ff207b53abeea1931def92434
parent0ebf2afa814a82dec149c37e51e09698ea527bad (diff)
* 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
-rw-r--r--ChangeLog5
-rw-r--r--test/ruby/test_io.rb4
2 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index f13e4d9733..7bf970168c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index 873da119be..9b3e80160d 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -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"