php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34408 fix Segmentation fault
Submitted: 2005-09-07 15:10 UTC Modified: 2005-09-15 01:00 UTC
From: anton at 310 dot ru Assigned:
Status: No Feedback Package: Reproducible crash
PHP Version: 5.0.5 OS: linux x86_64 kernel 2.6.9
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
47 + 11 = ?
Subscribe to this entry?

 
 [2005-09-07 15:10 UTC] 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();


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-09-07 15:38 UTC] tony2001@php.net
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.


 [2005-09-15 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jul 01 09:01:31 2024 UTC