#35406 [Opn->Asn]: eval hangs when evall'ed code ends with comment w/o newline
| From: | tony2001@php.net | Date: | Sat, 26 Nov 2005 09:05:33 +0000 |
| Subject: | #35406 [Opn->Asn]: 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-89029@lists.php.net to get a copy of this message | ||
ID: 35406
Updated by: tony2001@php.net
Reported By: moondream at moondream dot de
-Status: Open
+Status: Assigned
Bug Type: Scripting Engine problem
Operating System: Gentoo Linux
PHP Version: 5.1.0
-Assigned To:
+Assigned To: helly
New Comment:
Marcus, it's your patch causes this.
Previous Comments:
------------------------------------------------------------------------
[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