diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-05-31 23:00:48 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-05-31 23:00:48 +0000 |
commit | aa8cc01aa398d231c9839bc24b7b138f2c75952f (patch) | |
tree | 729f50a906bf36c3a714689104376b35e535451d /test/zlib | |
parent | 488f478d24019de88aa96944a0b91987ced37e12 (diff) | |
download | bundler-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.rb | 6 |
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 |