mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/zlib/zlib.c (zstream_run): fixed SEGV. [ruby-core:4712]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8345 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4c480ce6c1
commit
0cbf47a88f
2 changed files with 9 additions and 0 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
Mon Apr 18 11:25:14 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
|
||||||
|
|
||||||
|
* ext/zlib/zlib.c (zstream_run): fixed SEGV. [ruby-core:4712]
|
||||||
|
|
||||||
Sun Apr 17 23:57:49 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Sun Apr 17 23:57:49 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* ext/extmk.rb (extmake, parse_args): do not expand destdir.
|
* ext/extmk.rb (extmake, parse_args): do not expand destdir.
|
||||||
|
|
|
@ -706,6 +706,7 @@ zstream_run(z, src, len, flush)
|
||||||
{
|
{
|
||||||
uInt n;
|
uInt n;
|
||||||
int err;
|
int err;
|
||||||
|
volatile VALUE guard;
|
||||||
|
|
||||||
if (NIL_P(z->input) && len == 0) {
|
if (NIL_P(z->input) && len == 0) {
|
||||||
z->stream.next_in = "";
|
z->stream.next_in = "";
|
||||||
|
@ -715,6 +716,10 @@ zstream_run(z, src, len, flush)
|
||||||
zstream_append_input(z, src, len);
|
zstream_append_input(z, src, len);
|
||||||
z->stream.next_in = RSTRING(z->input)->ptr;
|
z->stream.next_in = RSTRING(z->input)->ptr;
|
||||||
z->stream.avail_in = RSTRING(z->input)->len;
|
z->stream.avail_in = RSTRING(z->input)->len;
|
||||||
|
/* keep reference to `z->input' so as not to be garbage collected
|
||||||
|
after zstream_reset_input() and prevent `z->stream.next_in'
|
||||||
|
from dangling. */
|
||||||
|
guard = z->input;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (z->stream.avail_out == 0) {
|
if (z->stream.avail_out == 0) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue