From: Antony Dovgal Date: Mon, 26 Jun 2006 23:22:45 +0000 (+0000) Subject: zero-terminate strings produced with FORCE_DEFLATE X-Git-Tag: RELEASE_1_0_0RC1~2629 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dfc2fd651c03d268b1e1530a9019e3dbe2c21588;p=php zero-terminate strings produced with FORCE_DEFLATE --- diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index e398c26a6e..089467018c 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -817,6 +817,8 @@ PHP_FUNCTION(gzencode) trailer[6] = (char) (stream.total_in >> 16) & 0xFF; trailer[7] = (char) (stream.total_in >> 24) & 0xFF; trailer[8] = '\0'; + } else { + s2[stream.total_out + GZIP_HEADER_LENGTH + (coding == CODING_GZIP ? GZIP_FOOTER_LENGTH : 0)] = '\0'; } RETURN_STRINGL(s2, stream.total_out + GZIP_HEADER_LENGTH + (coding == CODING_GZIP ? GZIP_FOOTER_LENGTH : 0), 0); } else {