Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:8146 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53476 invoked by uid 1010); 26 Feb 2004 05:31:41 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 53431 invoked from network); 26 Feb 2004 05:31:41 -0000 Received: from unknown (HELO moutng.kundenserver.de) (212.227.126.189) by pb1.pair.com with SMTP; 26 Feb 2004 05:31:41 -0000 Received: from [212.227.126.209] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1AwE7Y-0005fp-00 for internals@lists.php.net; Thu, 26 Feb 2004 06:31:40 +0100 Received: from [80.139.1.157] (helo=[80.139.1.157]) by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1) id 1AwE7Y-0005Qc-00 for internals@lists.php.net; Thu, 26 Feb 2004 06:31:40 +0100 To: internals@lists.php.net In-Reply-To: <1077771016.685.174.camel@localhost> References: <5.1.0.14.2.20040225164026.02c28540@127.0.0.1> <1077755589.685.74.camel@localhost> <1077771016.685.174.camel@localhost> Content-Type: multipart/mixed; boundary="=-Omhdv9SunyAkGHzpn4NH" Message-ID: <1077773231.685.177.camel@localhost> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Thu, 26 Feb 2004 06:27:11 +0100 X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:e958292ea7b1c44e51b2b9ca0a9da460 Subject: Re: Fwd: [PHP-DEV] RC1 From: thekid@thekid.de (Timm Friebe) --=-Omhdv9SunyAkGHzpn4NH Content-Type: text/plain Content-Transfer-Encoding: 7bit On Thu, 2004-02-26 at 05:50, Timm Friebe wrote: > On Thu, 2004-02-26 at 01:33, Timm Friebe wrote: > > On Wed, 2004-02-25 at 15:41, Andi Gutmans wrote: > > > Quick reminder... > > > If you have any bugs to fix, please fix them in the coming days. > > ...and another one: And yet another one (includes, as before, all of the following) and fixes the following (by adding a convert_to_string_ex() at the appropriate place): $ cat reflection_segfault.php $ php-dev reflection_segfault.php Segmentation fault (core dumped) - Timm --=-Omhdv9SunyAkGHzpn4NH Content-Disposition: attachment; filename=zend_reflection_api.diff Content-Type: text/x-patch; name=zend_reflection_api.diff; charset=iso-8859-1 Content-Transfer-Encoding: 7bit Index: Zend/zend_reflection_api.c =================================================================== RCS file: /repository/ZendEngine2/zend_reflection_api.c,v retrieving revision 1.88 diff -u -r1.88 zend_reflection_api.c --- Zend/zend_reflection_api.c 25 Feb 2004 08:58:56 -0000 1.88 +++ Zend/zend_reflection_api.c 26 Feb 2004 05:29:53 -0000 @@ -771,7 +771,10 @@ zend_class_entry *tmp_ce = ce->parent; zend_property_info *tmp_info; - while (tmp_ce && zend_hash_find(&ce->properties_info, prop_name, strlen(prop_name) + 1, (void **) &tmp_info) == SUCCESS) { + while (tmp_ce && zend_hash_find(&tmp_ce->properties_info, prop_name, strlen(prop_name) + 1, (void **) &tmp_info) == SUCCESS) { + if (tmp_info->flags != prop->flags) { /* private in super class, public in child => NOT the same property */ + break; + } ce = tmp_ce; prop = tmp_info; tmp_ce = tmp_ce->parent; @@ -1796,6 +1799,7 @@ zval_add_ref(&argument); } } else { + convert_to_string_ex(&argument); if (zend_lookup_class(Z_STRVAL_P(argument), Z_STRLEN_P(argument), &ce TSRMLS_CC) == FAILURE) { zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Class %s does not exist", Z_STRVAL_P(argument)); @@ -2298,6 +2302,14 @@ zend_fcall_info fci; zend_fcall_info_cache fcc; + if (!(ce->constructor->common.fn_flags & ZEND_ACC_PUBLIC)) { + zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, + "Acess to non-public constructor of class %s", + ce->name + ); + return; + } + params = safe_emalloc(sizeof(zval **), argc, 0); if (zend_get_parameters_array_ex(argc, params) == FAILURE) { efree(params); @@ -2564,19 +2576,22 @@ "Property %s::$%s does not exist", ce->name, name_str); return; } - free_alloca(lcname); - + if (!(property_info->flags & ZEND_ACC_PRIVATE)) { /* we have to seach the class hierarchy for this (implicit) public or protected property */ zend_class_entry *tmp_ce = ce->parent; zend_property_info *tmp_info; - while (tmp_ce && zend_hash_find(&ce->properties_info, name_str, name_len + 1, (void **) &tmp_info) == SUCCESS) { + while (tmp_ce && zend_hash_find(&tmp_ce->properties_info, lcname, name_len + 1, (void **) &tmp_info) == SUCCESS) { + if (tmp_info->flags != property_info->flags) { /* private in super class, public in child => NOT the same property */ + break; + } ce = tmp_ce; property_info = tmp_info; tmp_ce = tmp_ce->parent; } } + free_alloca(lcname); MAKE_STD_ZVAL(classname); ZVAL_STRINGL(classname, ce->name, ce->name_length, 1); --=-Omhdv9SunyAkGHzpn4NH--