From: anton at 310 dot ru Operating system: linux x86_64 kernel 2.6.9 PHP version: 5.0.5 PHP Bug Type: Reproducible crash Bug description: fix Segmentation fault
Description: ------------ fix Segmentation fault Reproduce code: --------------- --- zend_alloc.c.orig 2005-08-23 22:11:22.000000000 +0400 +++ zend_alloc.c 2005-09-04 16:57:33.000000000 +0400 @@ -103,7 +103,8 @@ #define REMOVE_POINTER_FROM_LIST(p) \ if (p==AG(head)) { \ AG(head) = p->pNext; \ - } else { \ + } else { \ + if(p->pLast) \ p->pLast->pNext = p->pNext; \ } \ if (p->pNext) { \ @@ -248,6 +249,10 @@ ZEND_API void _efree(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) { zend_mem_header *p = (zend_mem_header *) ((char *)ptr - sizeof(zend_mem_header) - MEM_HEADER _PADDING); + + if(!ptr) + return; + DECLARE_CACHE_VARS(); TSRMLS_FETCH(); -- Edit bug report at http://bugs.php.net/?id=34408&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34408&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34408&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34408&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=34408&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=34408&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=34408&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=34408&r=needscript Try newer version: http://bugs.php.net/fix.php?id=34408&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=34408&r=support Expected behavior: http://bugs.php.net/fix.php?id=34408&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=34408&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=34408&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=34408&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34408&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=34408&r=dst IIS Stability: http://bugs.php.net/fix.php?id=34408&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=34408&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=34408&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=34408&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=34408&r=mysqlcfg