From: judas dot iscariote at gmail dot com Operating system: all PHP version: 5CVS-2007-07-08 (CVS) PHP Bug Type: Scripting Engine problem Bug description: another crash in string to array conversion
Description: ------------ this is a variation of bug #41813 that produces segmentation fault as well.. Reproduce code: --------------- <?php $foo="50"; $foo[3]->bar[1] = "bang"; ?> Expected result: ---------------- Fatal error: Cannot use string offset as an array. Actual result: -------------- Program received signal SIGSEGV, Segmentation fault. 0x000000000072e990 in zend_fetch_property_address (result=0x7fffc1e290a0, container_ptr=0x0, prop_ptr=0x2b8aecc303e8, type=1) patch: Index: Zend/zend_execute.c =================================================================== RCS file: /repository/ZendEngine2/zend_execute.c,v retrieving revision 1.716.2.12.2.21 diff -u -r1.716.2.12.2.21 zend_execute.c --- Zend/zend_execute.c 27 Jun 2007 08:51:40 -0000 1.716.2.12.2.21 +++ Zend/zend_execute.c 8 Jul 2007 03:07:33 -0000 @@ -1233,8 +1233,13 @@ static void zend_fetch_property_address(temp_variable *result, zval **container_ptr, zval *prop_ptr, int type TSRMLS_DC) { zval *container; + + if (!container_ptr) { + zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); + } container = *container_ptr; + if (container == EG(error_zval_ptr)) { if (result) { result->var.ptr_ptr = &EG(error_zval_ptr); -- Edit bug report at http://bugs.php.net/?id=41919&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41919&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41919&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41919&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=41919&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=41919&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=41919&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=41919&r=needscript Try newer version: http://bugs.php.net/fix.php?id=41919&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=41919&r=support Expected behavior: http://bugs.php.net/fix.php?id=41919&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=41919&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=41919&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=41919&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41919&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=41919&r=dst IIS Stability: http://bugs.php.net/fix.php?id=41919&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=41919&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=41919&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=41919&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=41919&r=mysqlcfg