<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/zlib, branch ruby_2_7</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>merge revision(s) c51b92c18deb850d2cea3a7c9020db23b364ab72: [Backport #18358]</title>
<updated>2022-03-05T13:01:07+00:00</updated>
<author>
<name>NAKAMURA Usaku</name>
<email>usa@ruby-lang.org</email>
</author>
<published>2022-03-05T13:01:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=83de7133876ec392eb4b3b69c2220d7b49685444'/>
<id>83de7133876ec392eb4b3b69c2220d7b49685444</id>
<content type='text'>
    [ruby/zlib] [Bug #18358] Fix crash in zlib when in progress

    When Zlib::Inflate#inflate or Zlib::Deflate#deflate is called
    recursively inside the block, a crash can occur because of an
    use-after-free bug.

    https://github.com/ruby/zlib/commit/50fb8a0338
    ---
     ext/zlib/zlib.c        | 117 ++++++++++++++++++++++++++++++++-----------------
     test/zlib/test_zlib.rb |  10 ++++-
     2 files changed, 85 insertions(+), 42 deletions(-)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
    [ruby/zlib] [Bug #18358] Fix crash in zlib when in progress

    When Zlib::Inflate#inflate or Zlib::Deflate#deflate is called
    recursively inside the block, a crash can occur because of an
    use-after-free bug.

    https://github.com/ruby/zlib/commit/50fb8a0338
    ---
     ext/zlib/zlib.c        | 117 ++++++++++++++++++++++++++++++++-----------------
     test/zlib/test_zlib.rb |  10 ++++-
     2 files changed, 85 insertions(+), 42 deletions(-)
</pre>
</div>
</content>
</entry>
<entry>
<title>merge revision(s) b3d62a77d928eff01268ca7fa1c1c0966702926d [Backport #17803]</title>
<updated>2022-03-05T12:38:48+00:00</updated>
<author>
<name>NAKAMURA Usaku</name>
<email>usa@ruby-lang.org</email>
</author>
<published>2022-03-05T12:38:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=f740ffb81f3ef11526add528583b0cbfce28af67'/>
<id>f740ffb81f3ef11526add528583b0cbfce28af67</id>
<content type='text'>
    [ruby/zlib] Synchronize access to zstream to prevent segfault in
     multithreaded use

    I'm not sure whether this handles all multithreaded use cases,
    but this handles the example that crashes almost immediately
    and does 10,000,000 total deflates using 100 separate threads.

    To prevent the tests from taking forever, the committed test
    for this uses only 10,000 deflates across 10 separate threads,
    which still causes a segfault in the previous implementation
    almost immediately.

    Fixes [Bug #17803]

    https://github.com/ruby/zlib/commit/4b1023b3f2
    ---
     ext/zlib/zlib.c        | 33 ++++++++++++++++++++++++++-
     test/zlib/test_zlib.rb | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++
     2 files changed, 93 insertions(+), 1 deletion(-)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
    [ruby/zlib] Synchronize access to zstream to prevent segfault in
     multithreaded use

    I'm not sure whether this handles all multithreaded use cases,
    but this handles the example that crashes almost immediately
    and does 10,000,000 total deflates using 100 separate threads.

    To prevent the tests from taking forever, the committed test
    for this uses only 10,000 deflates across 10 separate threads,
    which still causes a segfault in the previous implementation
    almost immediately.

    Fixes [Bug #17803]

    https://github.com/ruby/zlib/commit/4b1023b3f2
    ---
     ext/zlib/zlib.c        | 33 ++++++++++++++++++++++++++-
     test/zlib/test_zlib.rb | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++
     2 files changed, 93 insertions(+), 1 deletion(-)
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/zlib] Fix setting mtime to zero in GzipWriter</title>
<updated>2019-10-31T13:23:58+00:00</updated>
<author>
<name>Alan Wu</name>
<email>XrXr@users.noreply.github.com</email>
</author>
<published>2019-10-25T23:15:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=0aaa15f6362e307c9ef636e9625027b96e577dfb'/>
<id>0aaa15f6362e307c9ef636e9625027b96e577dfb</id>
<content type='text'>
Before this change, it was not possible to write out zero for the
timestamp part of a Gzip file's header, as calling GzipWriter#mtime with
zero was ignored.

Judging from the docs for `GzipWriter#mtime=`, it should be possible to
indicate that no timestamp is available by calling the method with zero.

https://github.com/ruby/zlib/commit/310be39cac
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Before this change, it was not possible to write out zero for the
timestamp part of a Gzip file's header, as calling GzipWriter#mtime with
zero was ignored.

Judging from the docs for `GzipWriter#mtime=`, it should be possible to
indicate that no timestamp is available by calling the method with zero.

https://github.com/ruby/zlib/commit/310be39cac
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/zlib] Remove taint support</title>
<updated>2019-10-31T06:34:01+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2019-10-18T19:45:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=290903dba01d97bc6869886eccef0378dcdd5e0c'/>
<id>290903dba01d97bc6869886eccef0378dcdd5e0c</id>
<content type='text'>
Ruby 2.7 deprecates taint and it no longer has an effect.
The lack of taint support should not cause a problem in
previous Ruby versions.

https://github.com/ruby/zlib/commit/21711ed0ce
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Ruby 2.7 deprecates taint and it no longer has an effect.
The lack of taint support should not cause a problem in
previous Ruby versions.

https://github.com/ruby/zlib/commit/21711ed0ce
</pre>
</div>
</content>
</entry>
<entry>
<title>Suppress deflateParams() warnings</title>
<updated>2019-07-24T13:07:10+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2019-07-24T13:07:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=1cce4303247110d94eab8326f187a2a80130b324'/>
<id>1cce4303247110d94eab8326f187a2a80130b324</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>zlib (gzfile_write_raw): do not resize string after .write call</title>
<updated>2018-12-07T07:09:31+00:00</updated>
<author>
<name>normal</name>
<email>normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2018-12-07T07:09:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=cc9b57a2b4b6ddcf52502b3b1e827fcc0173ff7a'/>
<id>cc9b57a2b4b6ddcf52502b3b1e827fcc0173ff7a</id>
<content type='text'>
Apparently, a component of Rails implements a buffering .write
method which keeps the String buffer around and makes it unsafe
for us to clear it after calling .write.

This caused Rack::Deflater to give empty results when enabled.

Fortunately, per r61631 / a55abcc0ca6f628fc05304f81e5a044d65ab4a68,
this misguided optimization was only worth a small (0.5MB) savings
and we still benefit from the majority of the memory savings in
that change.

Thanks to zunda for the bug report.

[ruby-core:90133] [Bug #15356]

Fixes: r61631 (commit a55abcc0ca6f628fc05304f81e5a044d65ab4a68)
       ("zlib: reduce garbage on gzip writes (deflate)")

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Apparently, a component of Rails implements a buffering .write
method which keeps the String buffer around and makes it unsafe
for us to clear it after calling .write.

This caused Rack::Deflater to give empty results when enabled.

Fortunately, per r61631 / a55abcc0ca6f628fc05304f81e5a044d65ab4a68,
this misguided optimization was only worth a small (0.5MB) savings
and we still benefit from the majority of the memory savings in
that change.

Thanks to zunda for the bug report.

[ruby-core:90133] [Bug #15356]

Fixes: r61631 (commit a55abcc0ca6f628fc05304f81e5a044d65ab4a68)
       ("zlib: reduce garbage on gzip writes (deflate)")

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
<entry>
<title>test/zlib/test_zlib.rb (test_path): enable the accidentally-disabled assertion</title>
<updated>2018-04-17T06:38:08+00:00</updated>
<author>
<name>mame</name>
<email>mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2018-04-17T06:38:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=7735e2da11ecabdf27b71b8f3c3a240ee955b8df'/>
<id>7735e2da11ecabdf27b71b8f3c3a240ee955b8df</id>
<content type='text'>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
<entry>
<title>zlib.c: multiple arguments to write</title>
<updated>2017-10-23T07:06:12+00:00</updated>
<author>
<name>nobu</name>
<email>nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2017-10-23T07:06:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=585cbf65351ca10ebe673fefac22fdb9864779eb'/>
<id>585cbf65351ca10ebe673fefac22fdb9864779eb</id>
<content type='text'>
* ext/zlib/zlib.c (rb_gzwriter_write): accepts multiple arguments.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* ext/zlib/zlib.c (rb_gzwriter_write): accepts multiple arguments.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
<entry>
<title>zlib.c: memory leak in gunzip</title>
<updated>2017-10-06T13:41:37+00:00</updated>
<author>
<name>nobu</name>
<email>nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2017-10-06T13:41:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b268da23d2be376057b6184f2bddf50841f58728'/>
<id>b268da23d2be376057b6184f2bddf50841f58728</id>
<content type='text'>
* ext/zlib/zlib.c (zlib_gunzip): clear zstream to fix memory leak.
  [ruby-core:83162] [Bug #13982]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60130 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* ext/zlib/zlib.c (zlib_gunzip): clear zstream to fix memory leak.
  [ruby-core:83162] [Bug #13982]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60130 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
<entry>
<title>Zlib::GzipReader#pos underflows after calling #ungetbyte or #ungetc at start of file [Bug #13616]</title>
<updated>2017-07-14T09:17:55+00:00</updated>
<author>
<name>naruse</name>
<email>naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2017-07-14T09:17:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=7c9c2bc1dd470cd4794d6891b21ee1fc61f401e0'/>
<id>7c9c2bc1dd470cd4794d6891b21ee1fc61f401e0</id>
<content type='text'>
patched by Andrew Haines &lt;andrew@haines.org.nz&gt; [ruby-core:81488]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59333 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
patched by Andrew Haines &lt;andrew@haines.org.nz&gt; [ruby-core:81488]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59333 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
</feed>
