#34408 [Opn->Fbk]: fix Segmentation fault

From: Date: Wed, 07 Sep 2005 13:38:23 +0000
Subject: #34408 [Opn->Fbk]: fix Segmentation fault
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-84625@lists.php.net to get a copy of this message
ID: 34408 Updated by: tony2001@php.net Reported By: anton at 310 dot ru -Status: Open +Status: Feedback Bug Type: Reproducible crash Operating System: linux x86_64 kernel 2.6.9 PHP Version: 5.0.5 New Comment: Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If possible, make the script source available online and provide an URL to it here. Try to avoid embedding huge scripts into the report. Previous Comments: ------------------------------------------------------------------------ [2005-09-07 15:10:04] anton at 310 dot ru 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 this bug report at http://bugs.php.net/?id=34408&edit=1

« previous php.bugs (#84625) next »