cvs: ZendEngine2(PHP_5_3) / zend_API.c zend_execute_API.c

"Dmitry Stogov" <[email protected]>
Newsgroups gmane.comp.php.cvs.zend
Message-ID <cvsdmitry1217097140@cvsserver>
dmitry		Sat Jul 26 18:32:20 2008 UTC

  Modified files:              (Branch: PHP_5_3)
    /ZendEngine2	zend_API.c zend_execute_API.c 
  Log:
  Added checks for destroied objects
  
  
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_API.c?r1=1.296.2.27.2.34.2.43&r2=1.296.2.27.2.34.2.44&diff_format=u
Index: ZendEngine2/zend_API.c
diff -u ZendEngine2/zend_API.c:1.296.2.27.2.34.2.43 ZendEngine2/zend_API.c:1.296.2.27.2.34.2.44
--- ZendEngine2/zend_API.c:1.296.2.27.2.34.2.43	Sat Jul 26 13:14:00 2008
+++ ZendEngine2/zend_API.c	Sat Jul 26 18:32:20 2008
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_API.c,v 1.296.2.27.2.34.2.43 2008/07/26 13:14:00 dmitry Exp $ */
+/* $Id: zend_API.c,v 1.296.2.27.2.34.2.44 2008/07/26 18:32:20 dmitry Exp $ */
 
 #include "zend.h"
 #include "zend_execute.h"
@@ -2573,6 +2573,15 @@
 	fcc->calling_scope = NULL;
 	fcc->object_pp = NULL;
 
+	if (object_pp && (!*object_pp ||  Z_TYPE_PP(object_pp) != IS_OBJECT)) {
+		object_pp = NULL;
+	}
+	if (object_pp &&
+	    (!EG(objects_store).object_buckets || 
+	     !EG(objects_store).object_buckets[Z_OBJ_HANDLE_PP(object_pp)].valid)) {
+		return 0;
+	}
+
 	switch (Z_TYPE_P(callable)) {
 		case IS_STRING:
 			if (object_pp && *object_pp) {
@@ -2648,6 +2657,11 @@
 						}
 
 					} else {
+						if (!EG(objects_store).object_buckets || 
+						    !EG(objects_store).object_buckets[Z_OBJ_HANDLE_PP(obj)].valid) {
+							return 0;
+						}
+
 						fcc->calling_scope = Z_OBJCE_PP(obj); /* TBFixed: what if it's overloaded? */
 
 						fcc->object_pp = obj;
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_execute_API.c?r1=1.331.2.20.2.24.2.47&r2=1.331.2.20.2.24.2.48&diff_format=u
Index: ZendEngine2/zend_execute_API.c
diff -u ZendEngine2/zend_execute_API.c:1.331.2.20.2.24.2.47 ZendEngine2/zend_execute_API.c:1.331.2.20.2.24.2.48
--- ZendEngine2/zend_execute_API.c:1.331.2.20.2.24.2.47	Sat Jul 26 17:01:40 2008
+++ ZendEngine2/zend_execute_API.c	Sat Jul 26 18:32:20 2008
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_execute_API.c,v 1.331.2.20.2.24.2.47 2008/07/26 17:01:40 dmitry Exp $ */
+/* $Id: zend_execute_API.c,v 1.331.2.20.2.24.2.48 2008/07/26 18:32:20 dmitry Exp $ */
 
 #include <stdio.h>
 #include <signal.h>
@@ -744,7 +744,9 @@
 			zend_error(E_STRICT, "%s", error);
 			efree(error);
 		}
-		efree(callable_name);
+		if (callable_name) {
+			efree(callable_name);
+		}
 	}
 
 	EX(function_state).function = fci_cache->function_handler;



-- 
Zend Engine CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.