From: Ilia Alshanetsky Date: Sun, 21 Aug 2005 16:03:21 +0000 (+0000) Subject: MFH: Fixed bug #34191 (ob_gzhandler does not enforce trailing \0). X-Git-Tag: php-5.1.0RC2_PRE~88 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=daa209297d56e8c759fe2bd66c57c5647f0b7e9f;p=php MFH: Fixed bug #34191 (ob_gzhandler does not enforce trailing \0). --- diff --git a/NEWS b/NEWS index dbbf42e7e9..5431eff8d6 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,7 @@ PHP NEWS - Fixed "make test" to work for phpized extensions. (Hartmut, Jani) - Fixed failing queries (FALSE returned) with mysqli_query() on 64 bit systems. (Andrey) +- Fixed bug #34191 (ob_gzhandler does not enforce trailing \0). (Ilia) - Fixed bug #34156 (memory usage remains elevated after memory limit is reached). (Ilia) - Fixed bug #34148 (+,- and . not supported as parts of scheme). (Ilia) diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index d195597b13..ff68743ccd 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -644,6 +644,7 @@ static int php_do_deflate(uint str_length, Bytef **p_buffer, uint *p_buffer_len, if (do_end) { err = deflate(&ZLIBG(stream), Z_FINISH); + buffer[outlen - ZLIBG(stream).avail_out] = '\0'; } *p_buffer = buffer;