summaryrefslogtreecommitdiff
path: root/test/zlib
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-31 23:00:48 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-31 23:00:48 +0000
commitaa8cc01aa398d231c9839bc24b7b138f2c75952f (patch)
tree729f50a906bf36c3a714689104376b35e535451d /test/zlib
parent488f478d24019de88aa96944a0b91987ced37e12 (diff)
downloadbundler-aa8cc01aa398d231c9839bc24b7b138f2c75952f.tar.gz
zlib.c: check EOF
* ext/zlib/zlib.c (gzfile_read, gzfile_read_all, gzfile_getc), (gzreader_gets): check EOF. [ruby-core:55220] [Bug #8467] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/zlib')
-rw-r--r--test/zlib/test_zlib.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/zlib/test_zlib.rb b/test/zlib/test_zlib.rb
index 6e21f6d271..81d440f846 100644
--- a/test/zlib/test_zlib.rb
+++ b/test/zlib/test_zlib.rb
@@ -685,6 +685,7 @@ if defined? Zlib
end
def test_rewind
+ bug8467 = '[ruby-core:55220] [Bug #8467]'
Tempfile.create("test_zlib_gzip_reader_rewind") {|t|
t.close
Zlib::GzipWriter.open(t.path) {|gz| gz.print("foo") }
@@ -694,6 +695,11 @@ if defined? Zlib
f.rewind
assert_equal("foo", f.read)
end
+ open(t.path, "rb") do |f|
+ gz = Zlib::GzipReader.new(f)
+ gz.rewind
+ assert_equal(["foo"], gz.to_a, bug8467)
+ end
}
end