|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
[2017-03-14 23:08 UTC] bwoebi@php.net
[2017-03-14 23:08 UTC] bwoebi@php.net
-Status: Open
+Status: Closed
[2017-03-14 23:09 UTC] bwoebi@php.net
[2017-03-14 23:10 UTC] bwoebi@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 07:00:01 2025 UTC |
Description: ------------ deflate_add can grossly overestimate memory needed for the output buffer. This is more likely with highly compressable data. The allocations are roughly equal to the total bytes processed by deflate_add and can cause PHP to run out of memory. Test script: --------------- $deflator = deflate_init(ZLIB_ENCODING_RAW); $bytes = str_repeat("*", 65536); // if you use random bytes this usually can run forever // because they are not very compressable //$bytes = openssl_random_pseudo_bytes(65536); // this crashes after about 500 iterations if PHP is // configured for 64M for ($i = 0; $i < 100000; $i++) { echo "$i\n"; $output = deflate_add( $deflator, $bytes, ZLIB_SYNC_FLUSH ); }