--- Zlib.xs 2008-09-02 23:02:41.000000000 +0200 +++ Zlib.xs.oden 2009-07-19 21:56:12.000000000 +0200 @@ -1322,7 +1322,7 @@ inflate (s, buf, output, eof=FALSE) while (RETVAL == Z_OK) { if (s->stream.avail_out == 0 ) { /* out of space in the output buffer so make it bigger */ - Sv_Grow(output, SvLEN(output) + bufinc) ; + Sv_Grow(output, SvLEN(output) + bufinc +1) ; cur_length += increment ; s->stream.next_out = (Bytef*) SvPVbyte_nolen(output) + cur_length ; increment = bufinc ;