#35406 [Asn->Csd]: eval hangs when evall'ed code ends with comment w/o newline
| From: | helly@php.net | Date: | Sat, 26 Nov 2005 13:14:51 +0000 |
| Subject: | #35406 [Asn->Csd]: eval hangs when evall'ed code ends with comment w/o newline | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-89037@lists.php.net to get a copy of this message | ||
ID: 35406
Updated by: helly@php.net
Reported By: moondream at moondream dot de
-Status: Assigned
+Status: Closed
Bug Type: Scripting Engine problem
-Operating System: Gentoo Linux
+Operating System: *
PHP Version: 5.1.0
Assigned To: helly
New Comment:
This bug has been fixed in CVS.
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:
------------------------------------------------------------------------
[2005-11-26 10:05:33] tony2001@php.net
Marcus, it's your patch causes this.
------------------------------------------------------------------------
[2005-11-26 09:02:53] moondream at moondream dot de
Description:
------------
If the eval'ed code ends with a comment which is not termiated
by a newline, eval hangs in an endless loop. If the comment is
followed by a newline, there is no hang.
This causes phpBB2 on php 5.1 to hang.
Reproduce code:
---------------
<?php
$v='echo "Test\n"; // comment';
$w=$v."\n";
echo "Eval 1:";
eval ($w);
echo "Eval 2:";
eval ($v);
?>
Expected result:
----------------
The code sample returns after printing:
Eval 1:Test
Eval 2:Test
Actual result:
--------------
The code hangs after:
Eval 1:Test
Eval 2:
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=35406&edit=1