#34695 [NEW]: preg_replace(): {}-expresion overflow

From: Date: Fri, 30 Sep 2005 21:47:45 +0000
Subject: #34695 [NEW]: preg_replace(): {}-expresion overflow
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-85832@lists.php.net to get a copy of this message
From: php at koterov dot ru Operating system: Windows XP PHP version: 4.4.0 PHP Bug Type: Reproducible crash Bug description: preg_replace(): {}-expresion overflow 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 bug report at http://bugs.php.net/?id=34695&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34695&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34695&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34695&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=34695&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=34695&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=34695&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=34695&r=needscript Try newer version: http://bugs.php.net/fix.php?id=34695&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=34695&r=support Expected behavior: http://bugs.php.net/fix.php?id=34695&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=34695&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=34695&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=34695&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34695&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=34695&r=dst IIS Stability: http://bugs.php.net/fix.php?id=34695&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=34695&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=34695&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=34695&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=34695&r=mysqlcfg

« previous php.bugs (#85832) next »