From daa209297d56e8c759fe2bd66c57c5647f0b7e9f Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Sun, 21 Aug 2005 16:03:21 +0000 Subject: MFH: Fixed bug #34191 (ob_gzhandler does not enforce trailing \0). --- ext/zlib/zlib.c | 1 + 1 file changed, 1 insertion(+) (limited to 'ext/zlib') 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; -- cgit v1.2.1