cvs: ZendEngine2(PHP_5_0) / zend_objects_API.c /tests bug34617.phpt php-src NEWS
| From: | Dmitry Stogov | Date: | Tue, 27 Sep 2005 18:07:22 +0000 |
| Subject: | cvs: ZendEngine2(PHP_5_0) / zend_objects_API.c /tests bug34617.phpt php-src NEWS | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-4182@lists.php.net to get a copy of this message | ||
dmitry Tue Sep 27 14:07:22 2005 EDT
Added files: (Branch: PHP_5_0)
/ZendEngine2/tests bug34617.phpt
Modified files:
/php-src NEWS
/ZendEngine2 zend_objects_API.c
Log:
Fixed bug #34617 (zend_deactivate: objects_store used after zend_objects_store_destroy is called)
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.485&r2=1.1760.2.486&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1760.2.485 php-src/NEWS:1.1760.2.486
--- php-src/NEWS:1.1760.2.485 Tue Sep 27 11:26:24 2005
+++ php-src/NEWS Tue Sep 27 14:07:21 2005
@@ -3,6 +3,8 @@
?? ??? ????, PHP 5.0.6
- Renamed CachingRecursiveIterator to RecursiveCachingIterator. (Marcus)
- Fixed bug #34643 (wsdl default value has no effect). (Dmitry)
+- Fixed bug #34617 (zend_deactivate: objects_store used after
+ zend_objects_store_destroy is called). (Dmitry)
- Fixed bug #34505 (Possible memory corruption when unmangling properties
with empty names). (Tony)
- Fixed bug #34478 (Incorrect parsing of url's fragment (#...)). (Dmitry)
http://cvs.php.net/diff.php/ZendEngine2/zend_objects_API.c?r1=1.41.2.5&r2=1.41.2.6&ty=u
Index: ZendEngine2/zend_objects_API.c
diff -u ZendEngine2/zend_objects_API.c:1.41.2.5 ZendEngine2/zend_objects_API.c:1.41.2.6
--- ZendEngine2/zend_objects_API.c:1.41.2.5 Mon Jun 6 06:38:22 2005
+++ ZendEngine2/zend_objects_API.c Tue Sep 27 14:07:21 2005
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_objects_API.c,v 1.41.2.5 2005/06/06 10:38:22 dmitry Exp $ */
+/* $Id: zend_objects_API.c,v 1.41.2.6 2005/09/27 18:07:21 dmitry Exp $ */
#include "zend.h"
#include "zend_globals.h"
@@ -38,6 +38,7 @@
ZEND_API void zend_objects_store_destroy(zend_objects_store *objects)
{
efree(objects->object_buckets);
+ objects->object_buckets = NULL;
}
ZEND_API void zend_objects_store_call_destructors(zend_objects_store *objects TSRMLS_DC)
@@ -138,9 +139,16 @@
ZEND_API void zend_objects_store_del_ref(zval *zobject TSRMLS_DC)
{
- zend_object_handle handle = Z_OBJ_HANDLE_P(zobject);
- struct _store_object *obj = &EG(objects_store).object_buckets[handle].bucket.obj;
+ zend_object_handle handle;
+ struct _store_object *obj;
+ if (!EG(objects_store).object_buckets) {
+ return;
+ }
+
+ handle = Z_OBJ_HANDLE_P(zobject);
+ obj = &EG(objects_store).object_buckets[handle].bucket.obj;
+
/* Make sure we hold a reference count during the destructor call
otherwise, when the destructor ends the storage might be freed
when the refcount reaches 0 a second time
http://cvs.php.net/co.php/ZendEngine2/tests/bug34617.phpt?r=1.1&p=1
Index: ZendEngine2/tests/bug34617.phpt
+++ ZendEngine2/tests/bug34617.phpt