note 111509 deleted from function.gzinflate by salathe
| From: | salathe@php.net | Date: | Thu, 28 Feb 2013 16:47:00 +0000 |
| Subject: | note 111509 deleted from function.gzinflate by salathe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-193751@lists.php.net to get a copy of this message | ||
Note Submitter: felix dot klee at inka dot de
----
With PHP 5.3 running on 32bit LINUX, I cannot reproduce the issues reported by @akniep. The code
below correctly outputs:
10000000
10000000
0
0
<?php
function tryToGzinflate($deflatedData, $maxLen = 0) {
$data = gzinflate($deflatedData, $maxLen);
echo strlen($data).'<br>';
}
$data = '';
for ($i = 0; $i < 10000000; $i++)
$data .= chr(mt_rand(97, 122)); // a-z
$deflatedData = gzdeflate($data);
tryToGzinflate($deflatedData);
tryToGzinflate($deflatedData, strlen($data));
tryToGzinflate($deflatedData, 100);
ini_set('memory_limit', '100');
tryToGzinflate($deflatedData, 100);
tryToGzinflate($deflatedData); // causes fatal out-of-memory error