Re: PHP (anti) crash policy?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Manuel Lemos wrote:
Hello,

On 10/01/2004 11:34 AM, Olaf Van Der Spek wrote:

If it is not normal, why don't you just evaluate the expected memory size that is going to be allocated before calling the PHP function that does it and handle the situation within your PHP code?



Because I've no idea how gzinflate decides how much memory to allocate.


Use worse case estimates. AFAIK, that algorithm can only compress upto 5:1 . If you are taking data from a file, read the file size and multiply by 5 . If the resulting case exceeds the reasonable memory limit, you should not bother to even try opening that way.

I know. But the crashing input is just 144 kb.
It's an invalid stream, but I do expect my script not to crash when it encounters such a stream.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux