ID:               39934
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Open
+Status:           Bogus
 Bug Type:         PCRE related
 Operating System: Irrelevant
 PHP Version:      4.4.4
 New Comment:

Stack overflow in PCRE has been reported many times and is not really a
problem in PHP, though newer PHP versions (5.2.0+) have a workaround for
this problem.
See pcre.backtrack_limit @ http://php.net/pcre


Previous Comments:
------------------------------------------------------------------------

[2006-12-22 20:35:40] [EMAIL PROTECTED]

Description:
------------
It is a reduction of http://pear.php.net/bugs/bug.php?id=7908

This test is breaking by repeat=437 by php-4.4.4 Windows NT and 10000
by php 5.1.6 linux FC5

It's not breaking if you give ok=1 or nomatch=1 or reduce enough
repeat.

Note: it's php version irrelevent , but your sytem forced to choose
some.

Reproduce code:
---------------
<?php
error_reporting(E_ALL);
ini_set('display_errors', true);

function process($matches)
{
        return $matches[0];
}
$regex = isset($_GET['ok']) ? '#X(.*?)X#' : '#X((.)*?)X#';
$around = isset($_GET['nomatch']) ? 'Y' : 'X';
$repeat = isset($_GET['repeat']) ? (int) $_GET['repeat'] : 10000;

$source = $around . str_repeat('a', $repeat) . $around;

$transform = preg_replace_callback($regex, 'process', $source);

echo '---Text---' . strlen($source) . "\n";

echo "---Transform---" . strlen($transform) . "\n";
?>




------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=39934&edit=1

Reply via email to