From 3fa81199add4d7379511406fb50c814bc35364bf Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Tue, 25 Oct 2005 15:35:22 +0000 Subject: [PATCH] - fix the fix --- ext/zlib/zlib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index a6b19d5ce6..19e49ac840 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -625,7 +625,7 @@ static int php_do_deflate(uint str_length, Bytef **p_buffer, uint *p_buffer_len, int start_offset = ((do_start && ZLIBG(compression_coding) == CODING_GZIP) ? 10 : 0); int end_offset = (do_end ? 8 : 0); - outlen = (uint) (sizeof(char) * (str_length / PHP_ZLIB_MODIFIER + 12) + 1); /* leave some room for a trailing \0 */ + outlen = (uint) (str_length + (str_length / PHP_ZLIB_MODIFIER) + 12 + 1); /* leave some room for a trailing \0 */ if ((outlen + start_offset + end_offset) > *p_buffer_len) { buffer = (Bytef *) emalloc(outlen + start_offset + end_offset); } else { -- 2.40.0