From: Antony Dovgal Date: Mon, 26 Jun 2006 23:22:58 +0000 (+0000) Subject: MFH: zero-terminate strings produced with FORCE_DEFLATE X-Git-Tag: php-5.2.0RC1~236 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e24fe395a2118efbb5456e5cce75988e4739d3bb;p=php MFH: zero-terminate strings produced with FORCE_DEFLATE --- diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index d3932f41ad..e9bea6cf0f 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -820,6 +820,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 {