cvs: ZendEngine2(PHP_5_2) / zend_object_handlers.c /tests bug44141.phpt php-src NEWS

[email protected] ("Dmitry Stogov")
Newsgroups php.zend-engine.cvs
Message-ID <cvsdmitry1203602122@cvsserver>
dmitry		Thu Feb 21 13:55:22 2008 UTC

  Added files:                 (Branch: PHP_5_2)
    /ZendEngine2/tests	bug44141.phpt 

  Modified files:              
    /php-src	NEWS 
    /ZendEngine2	zend_object_handlers.c 
  Log:
  Fixed bug #44141 (private parent constructor callable through static function)
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1090&r2=1.2027.2.547.2.1091&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.1090 php-src/NEWS:1.2027.2.547.2.1091
--- php-src/NEWS:1.2027.2.547.2.1090	Thu Feb 21 13:37:52 2008
+++ php-src/NEWS	Thu Feb 21 13:55:21 2008
@@ -20,6 +20,8 @@
 - Fixed bug #44159 (Crash: $pdo->setAttribute(PDO::STATEMENT_ATTR_CLASS, NULL)).
   (Felipe)
 - Fixed bug #44152 (Possible crash with syslog logging on ZTS builds). (Ilia)
+- Fixed bug #44141 (private parent constructor callable through static
+  function). (Dmitry)
 - Fixed bug #44069 (Huge memory usage with concatenation using . instead of
   .=). (Dmitry)
 - Fixed bug #44046 (crash inside array_slice() function with an invalid
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_object_handlers.c?r1=1.135.2.6.2.27&r2=1.135.2.6.2.28&diff_format=u
Index: ZendEngine2/zend_object_handlers.c
diff -u ZendEngine2/zend_object_handlers.c:1.135.2.6.2.27 ZendEngine2/zend_object_handlers.c:1.135.2.6.2.28
--- ZendEngine2/zend_object_handlers.c:1.135.2.6.2.27	Fri Feb 15 07:44:46 2008
+++ ZendEngine2/zend_object_handlers.c	Thu Feb 21 13:55:22 2008
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_object_handlers.c,v 1.135.2.6.2.27 2008/02/15 07:44:46 dmitry Exp $ */
+/* $Id: zend_object_handlers.c,v 1.135.2.6.2.28 2008/02/21 13:55:22 dmitry Exp $ */
 
 #include "zend.h"
 #include "zend_globals.h"
@@ -944,7 +944,7 @@
 		} else if (constructor->op_array.fn_flags & ZEND_ACC_PRIVATE) {
 			/* Ensure that if we're calling a private function, we're allowed to do so.
 			 */
-			if (Z_OBJ_HANDLER_P(object, get_class_entry)(object TSRMLS_CC) != EG(scope)) {
+			if (constructor->common.scope != EG(scope)) {
 				if (EG(scope)) {
 					zend_error(E_ERROR, "Call to private %s::%s() from context '%s'", constructor->common.scope->name, constructor->common.function_name, EG(scope)->name);
 				} else {

http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug44141.phpt?view=markup&rev=1.1
Index: ZendEngine2/tests/bug44141.phpt
+++ ZendEngine2/tests/bug44141.phpt
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.