#34695 [Opn->Fbk]: preg_replace(): {}-expresion overflow
ID: 34695
Updated by: johannes@php.net
Reported By: php at koterov dot ru
-Status: Open
+Status: Feedback
Bug Type: Reproducible crash
Operating System: Windows XP
PHP Version: 4.4.0
New Comment:
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
Previous Comments:
------------------------------------------------------------------------
[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
Thread (7 messages)