#34695 [Opn->Bgs]: preg_replace(): {}-expresion overflow
| From: | sniper@php.net | Date: | Sun, 02 Oct 2005 11:00:59 +0000 |
| Subject: | #34695 [Opn->Bgs]: preg_replace(): {}-expresion overflow | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-85873@lists.php.net to get a copy of this message | ||
ID: 34695
Updated by: sniper@php.net
Reported By: php at koterov dot ru
-Status: Open
+Status: Bogus
Bug Type: Reproducible crash
Operating System: Windows XP
PHP Version: 4.4.0
New Comment:
RTFM: "You should be aware of some limitations of PCRE. Read
http://www.pcre.org/pcre.txt for more info."
Previous Comments:
------------------------------------------------------------------------
[2005-10-02 08:46:36] php at koterov dot ru
Snapshot does not work too.
------------------------------------------------------------------------
[2005-10-01 10:10:46] johannes@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
------------------------------------------------------------------------
[2005-09-30 23:47:44] php at koterov dot ru
Description:
------------
PCRE /X{1,Y}/ for large Y (near 1000) does not work for some X on
Windows (apache 1.3+mod_php 4.4.0 or 4.3.10). In Unix (Linux) -
everything is fine. Maybe stack overflow?
Reproduce code:
---------------
<?
define('MAXLEN', 1000);
$text = str_repeat('a', 10000);
$text = preg_replace('/ ( (?: [^<] | < [^>]* >){1,'.MAXLEN.'}) .*
/xs',
'$1', $text);
die('ok');
?>
Expected result:
----------------
ok
Actual result:
--------------
nothing (php exits, but no windows GPF)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=34695&edit=1