#50148 [NEW]: [PATCH] - zend_get_property_info should check for Z_TYPE_P(member) == IS_STRING
| From: | yoarvi at gmail dot com | Date: | Wed, 11 Nov 2009 10:43:01 +0000 |
| Subject: | #50148 [NEW]: [PATCH] - zend_get_property_info should check for Z_TYPE_P(member) == IS_STRING | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-144453@lists.php.net to get a copy of this message | ||
From: yoarvi at gmail dot com
Operating system: Solaris 10/SPARC
PHP version: 6SVN-2009-11-11 (SVN)
PHP Bug Type: Unicode Engine related
Bug description: [PATCH] - zend_get_property_info should check for Z_TYPE_P(member) == IS_STRING
Description:
------------
When I ran 'gmake test' on my PHP6 tree on Solaris 10 (SPARC), I noticed
many test failures.
The following patch fixes many(~350) of these test failures:
Index: Zend/zend_object_handlers.c
===================================================================
--- Zend/zend_object_handlers.c (revision 290471)
+++ Zend/zend_object_handlers.c (working copy)
@@ -198,7 +198,7 @@
ulong h;
if ((Z_TYPE_P(member) == IS_UNICODE && Z_USTRVAL_P(member)[0] ==
0) ||
- Z_STRVAL_P(member)[0] == '\0') {
+ (Z_TYPE_P(member) == IS_STRING && Z_STRVAL_P(member)[0] ==
'\0')) {
if (!silent) {
if (Z_UNILEN_P(member) == 0) {
zend_error(E_ERROR, "Cannot access empty
property");
Reproduce code:
---------------
% sapi/cli/php tests/classes/__call_001.php
Expected result:
----------------
Method test called:
array(4) {
[0]=>
int(1)
[1]=>
unicode(1) "2"
[2]=>
float(3.4)
[3]=>
bool(true)
}
array(3) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
}
Actual result:
--------------
Method test called:
array(4) {
[0]=>
int(1)
[1]=>
unicode(1) "2"
[2]=>
float(3.4)
[3]=>
bool(true)
}
Fatal error: Cannot access property started with '\0' in
/space/arvind/php-src-6/tests/classes/__call_001.phpt on line 14
--
Edit bug report at http://bugs.php.net/?id=50148&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=50148&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=50148&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=50148&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=50148&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=50148&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=50148&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=50148&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=50148&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=50148&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=50148&r=support
Expected behavior: http://bugs.php.net/fix.php?id=50148&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=50148&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=50148&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=50148&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=50148&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=50148&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=50148&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=50148&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=50148&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=50148&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=50148&r=mysqlcfg