From: Michael Wallner Date: Tue, 25 Oct 2005 15:35:39 +0000 (+0000) Subject: - fix the fix X-Git-Tag: php-5.1.0RC4~31 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2c5c8c161cc5009b5c2921299a3b0e7a2428bdce;p=php - fix the fix --- 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 {