Permalink
Browse files

fix the buffer allocation in zstream_expand_buffer_into() since rb_bs…

…tr_new() does not allocate buffer to store the binary strings
  • Loading branch information...
1 parent 12b7c19 commit bfd2493b6e306bb2ff5864d3bf2acaeb273b93cd @Watson1978 Watson1978 committed Jun 5, 2012
Showing with 1 addition and 0 deletions.
  1. +1 −0 ext/zlib/zlib.c
View
@@ -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;

0 comments on commit bfd2493

Please sign in to comment.