|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-09-19 16:17 UTC] OvdSpek at LIACS dot NL
Description: ------------ The following PHP script appears to cause a full crash/restart of my Apache/2.0.50 (Win32) PHP/4.3.9RC3 Server at localhost Port 80 server on Windows XP. http://213.46.64.114/temp/php_crash.bin http://62.216.18.38/temp/php_crash.bin Reproduce code: --------------- <?php $s = file_get_contents('f:/temp/php_crash.bin'); gzinflate(substr($s, 10)); ?> Expected result: ---------------- No errors. Actual result: -------------- FATAL: erealloc(): Unable to allocate 603602944 bytes [Sun Sep 19 16:11:16 2004] [notice] Parent: child process exited with status 1 -- Restarting. [Sun Sep 19 16:11:16 2004] [notice] Parent: Created child process 3908 [Sun Sep 19 16:11:16 2004] [notice] Child 3908: Child process is running [Sun Sep 19 16:11:16 2004] [notice] Child 3908: Acquired the start mutex. [Sun Sep 19 16:11:16 2004] [notice] Child 3908: Starting 250 worker threads. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 16:00:02 2025 UTC |
But /php4/ext/zlib/zlib.c is your code right? Not the code from the zlib authors? The bug isn't in zlib owned code, it's in php owned code, and that's your code. This code indeed expects to get NULL if erealloc fails. Is there a flag for erealloc or function to use that doesn't 'cause an exception' and instead just returns NULL? s2 = (char *) erealloc(s1,length); if(! s2) { if(s1) efree(s1); RETURN_FALSE; }