From c8dedc16a894e233d8cdf7850df6f07c9ac303fc Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Sun, 21 Aug 2005 16:02:25 +0000 Subject: [PATCH] Fixed bug #34191 (ob_gzhandler does not enforce trailing \0). --- ext/zlib/zlib.c | 1 + 1 file changed, 1 insertion(+) 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; -- 2.50.1