Skip to content

Commit

Permalink
fix the buffer allocation in zstream_expand_buffer_into() since rb_bs…
Browse files Browse the repository at this point in the history
…tr_new() does not allocate buffer to store the binary strings
  • Loading branch information
Watson1978 committed Jun 5, 2012
1 parent b06ac56 commit 9c78016
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ext/zlib/zlib.c
Expand Up @@ -474,6 +474,7 @@ zstream_expand_buffer_into(struct zstream *z, int size)
{
if (NIL_P(z->buf)) {
GC_WB(&z->buf, rb_bstr_new());
rb_bstr_resize(z->buf, size);
z->buf_filled = 0;
z->stream.next_out = BSTRING_PTR_BYTEF(z->buf);
z->stream.avail_out = size;
Expand Down

0 comments on commit 9c78016

Please sign in to comment.