diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-10-22 15:28:13 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-10-22 15:28:13 +0000 |
commit | 9e84c34ec50e06a7b602c173623b4b408a4a75c5 (patch) | |
tree | 04cdf0127e7e93fff6e4c4f7ce40a37493f6a86d | |
parent | 63232c5f3c0f20c9fd3fda7168c25eb437c4f9ad (diff) | |
download | ruby-9e84c34ec50e06a7b602c173623b4b408a4a75c5.tar.gz ruby-9e84c34ec50e06a7b602c173623b4b408a4a75c5.tar.xz ruby-9e84c34ec50e06a7b602c173623b4b408a4a75c5.zip |
* ext/zlib/zlib.c (zstream_run): always use zstream_append_input()
to avoid SEGV. [ruby-dev:24568]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@7102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ext/zlib/zlib.c | 12 |
2 files changed, 8 insertions, 9 deletions
@@ -1,3 +1,8 @@ +Sat Oct 23 00:20:55 2004 Yukihiro Matsumoto <matz@ruby-lang.org> + + * ext/zlib/zlib.c (zstream_run): always use zstream_append_input() + to avoid SEGV. [ruby-dev:24568] + Fri Oct 22 12:02:28 2004 Yukihiro Matsumoto <matz@ruby-lang.org> * eval.c (rb_alias): was warning for wrong condition. diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index aed2a2613..633bd2d3b 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -699,15 +699,9 @@ zstream_run(z, src, len, flush) uInt n; int err; - if (NIL_P(z->input)) { - z->stream.next_in = src; - z->stream.avail_in = len; - } - else { - zstream_append_input(z, src, len); - z->stream.next_in = RSTRING(z->input)->ptr; - z->stream.avail_in = RSTRING(z->input)->len; - } + zstream_append_input(z, src, len); + z->stream.next_in = RSTRING(z->input)->ptr; + z->stream.avail_in = RSTRING(z->input)->len; if (z->stream.avail_out == 0) { zstream_expand_buffer(z); |