#49866 [Asn->Csd]: Making reference on string offsets crashes PHP
| From: | dmitry@php.net | Date: | Mon, 07 Dec 2009 08:47:47 +0000 |
| Subject: | #49866 [Asn->Csd]: Making reference on string offsets crashes PHP | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-145470@lists.php.net to get a copy of this message | ||
ID: 49866
Updated by: dmitry@php.net
Reported By: doctorrock83 at gmail dot com
-Status: Assigned
+Status: Closed
Bug Type: Scripting Engine problem
Operating System: Linux
PHP Version: 5.3.0
Assigned To: dmitry
New Comment:
This bug has been fixed in SVN.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2009-12-07 08:47:19] svn@php.net
Automatic comment from SVN on behalf of dmitry
Revision: http://svn.php.net/viewvc/?view=revision&revision=291810
Log: Fixed bug #49866 (Making reference on string offsets crashes PHP)
------------------------------------------------------------------------
[2009-10-13 17:30:19] felipe@php.net
Dmitry, this is related to rev.251187 and rev.244680 (fix for #35163)
------------------------------------------------------------------------
[2009-10-13 16:08:41] doctorrock83 at gmail dot com
Description:
------------
When making a reference on a string offset and changing it, PHP5.3
crashes with segfault, but PHP 5.2, 5.1 and 5.0 throws errors.
I know that it's a bad PHP programming than thinking PHP is C, the fact
is that this behavior gives PHP errors in 5.2/5.1/5.0 branches, but
segfaults 5.3.0 release.
Reproduce code:
---------------
<?php
$a = "string";
$b = &$a[1];
$b = "f";
echo $a;
Expected result:
----------------
sfring
But PHP5.2.0 and 5.0.0 tell :
"Fatal error: Cannot create references to/from string offsets nor
overloaded objects in XXX"
PHP 5.1.0 tells:
"Fatal error: fatal flex scanner internal error--end of buffer missed
in XXX"
PHP5.3 segfaults
Actual result:
--------------
segmentation faults
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=49866&edit=1