#28938 [Com]: foreach statement can be forced to crash PHP
| From: | fixxxer at php5 dot ru | Date: | Tue, 13 Jul 2004 16:13:24 +0000 |
| Subject: | #28938 [Com]: foreach statement can be forced to crash PHP | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-62152@lists.php.net to get a copy of this message | ||
ID: 28938
Comment by: fixxxer at php5 dot ru
Reported By: tomas_matousek at hotmail dot com
Status: Open
Bug Type: Scripting Engine problem
Operating System: WinXP
PHP Version: 5.0.0RC3
New Comment:
Reproduced on WinXP, latest snap. Could not reproduce on FreeBSD. Seems
to be win32 specific
Previous Comments:
------------------------------------------------------------------------
[2004-06-30 07:10:02] curt@php.net
here is some output in debug mode:
$a = array(0,1);
foreach ($a as $value)
{
$a->foo = "bar";
}
PHP Warning: Attempt to assign property of non-object in
/php/bugs/28938.php on line 6
PHP Warning: Attempt to assign property of non-object in
/php/bugs/28938.php on line 6
[Wed Jun 30 05:09:40 2004] Script: '28938.php'
---------------------------------------
/php/php-src/Zend/zend_execute.c(76) : Block 0x0840AAEC status:
/cvs/php/php-src/Zend/zend_execute.h(61) : Actual location (location
was relayed)
Beginning: Overrun (magic=0x00000006, expected=0x7312F8DC)
End: Unknown
---------------------------------------
PHP Warning: String is not zero-terminated (ZZZZ...)
(source: /cvs/php/php-src/Zend/zend_opcode.c:215) in Unknown on
line 0
[Wed Jun 30 05:09:40 2004] Script: '28938.php'
---------------------------------------
/cvs/php/php-src/Zend/zend_opcode.c(215) : Block 0x0840BD18 status:
/cvs/php/php-src/Zend/zend_variables.c(45) : Actual location (location
was relayed)
Beginning: Cached (allocated on
/cvs/php/php-src/Zend/zend_language_scanner.l:1510, 4 bytes)
End: OK
---------------------------------------
------------------------------------------------------------------------
[2004-06-28 09:25:32] tomas_matousek at hotmail dot com
Description:
------------
The following code crashes PHP.
Reproduce code:
---------------
$a = array(0,1,2);
foreach ($a as $value)
{
$a->foo = "bar";
}
Expected result:
----------------
none
Actual result:
--------------
crash
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=28938&edit=1