cvs: ZendEngine2(PHP_5_0) / zend_execute_API.c /tests bug32596.phpt php-src NEWS
| From: | Dmitry Stogov | Date: | Mon, 06 Jun 2005 09:50:09 +0000 |
| Subject: | cvs: ZendEngine2(PHP_5_0) / zend_execute_API.c /tests bug32596.phpt php-src NEWS | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-3723@lists.php.net to get a copy of this message | ||
dmitry Mon Jun 6 05:50:09 2005 EDT
Added files: (Branch: PHP_5_0)
/ZendEngine2/tests bug32596.phpt
Modified files:
/php-src NEWS
/ZendEngine2 zend_execute_API.c
Log:
Fixed bug #32596 (Segfault/Memory Leak by getClass (etc) in __destruct)
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.420&r2=1.1760.2.421&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1760.2.420 php-src/NEWS:1.1760.2.421
--- php-src/NEWS:1.1760.2.420 Mon Jun 6 03:51:15 2005
+++ php-src/NEWS Mon Jun 6 05:50:05 2005
@@ -82,6 +82,8 @@
access errors). (Jani, ric at arizona dot edu)
- Fixed bug #32608 (html_entity_decode() converts single quotes even if
ENT_NOQUOTES is given). (Ilia)
+- Fixed bug #32596 (Segfault/Memory Leak by getClass (etc) in __destruct).
+ (Dmitry)
- Fixed bug #32591 (ext/mysql: Unsatisfied symbol: ntohs with HP-UX). (Jani)
- Fixed bug #32589 (Possible crash inside imap_mail_compose, with charsets).
(Ilia)
http://cvs.php.net/diff.php/ZendEngine2/zend_execute_API.c?r1=1.287.2.17&r2=1.287.2.18&ty=u
Index: ZendEngine2/zend_execute_API.c
diff -u ZendEngine2/zend_execute_API.c:1.287.2.17 ZendEngine2/zend_execute_API.c:1.287.2.18
--- ZendEngine2/zend_execute_API.c:1.287.2.17 Fri Jun 3 11:36:48 2005
+++ ZendEngine2/zend_execute_API.c Mon Jun 6 05:50:07 2005
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_execute_API.c,v 1.287.2.17 2005/06/03 15:36:48 dmitry Exp $ */
+/* $Id: zend_execute_API.c,v 1.287.2.18 2005/06/06 09:50:07 dmitry Exp $ */
#include <stdio.h>
#include <signal.h>
@@ -392,15 +392,17 @@
ZEND_API void _zval_ptr_dtor(zval **zval_ptr ZEND_FILE_LINE_DC)
{
+ zval *zv = *zval_ptr;
+
#if DEBUG_ZEND>=2
printf("Reducing refcount for %x (%x): %d->%d\n", *zval_ptr, zval_ptr,
(*zval_ptr)->refcount, (*zval_ptr)->refcount-1);
#endif
- (*zval_ptr)->refcount--;
- if ((*zval_ptr)->refcount==0) {
- zval_dtor(*zval_ptr);
- safe_free_zval_ptr_rel(*zval_ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC);
- } else if ((*zval_ptr)->refcount == 1) {
- (*zval_ptr)->is_ref = 0;
+ zv->refcount--;
+ if (zv->refcount==0) {
+ zval_dtor(zv);
+ safe_free_zval_ptr_rel(zv ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_CC);
+ } else if (zv->refcount == 1) {
+ zv->is_ref = 0;
}
}
http://cvs.php.net/co.php/ZendEngine2/tests/bug32596.phpt?r=1.1&p=1
Index: ZendEngine2/tests/bug32596.phpt
+++ ZendEngine2/tests/bug32596.phpt