mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
zlib.c: no buf_filled in zstream
* ext/zlib/zlib.c (zstream): manage capacity and size of `buf` instead of size and separated member `buf_filled`. reported by Christian Jalio (jalio) at https://hackerone.com/reports/211958 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c4c3d86a1f
commit
d70e47dc6b
2 changed files with 69 additions and 68 deletions
|
@ -127,6 +127,16 @@ if defined? Zlib
|
|||
assert_equal("foobar", Zlib::Inflate.inflate(s))
|
||||
end
|
||||
|
||||
def test_expand_buffer;
|
||||
z = Zlib::Deflate.new
|
||||
src = "baz" * 1000
|
||||
z.avail_out = 1
|
||||
GC.stress = true
|
||||
s = z.deflate(src, Zlib::FINISH)
|
||||
GC.stress = false
|
||||
assert_equal(src, Zlib::Inflate.inflate(s))
|
||||
end
|
||||
|
||||
def test_total
|
||||
z = Zlib::Deflate.new
|
||||
1000.times { z << "foo" }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue