From:             peter dot mescalchin at gmail dot com
Operating system: Windows XP
PHP version:      5.1.5
PHP Bug Type:     PCRE related
Bug description:  PCRE 6.6 crashing PHP with specific calls to preg_match()

Description:
------------
Passing large strings to PCRE functions in PHP versions 5.1.3 or greater
and Apache 2.0.59 with the regexp "/(\r|\n|.)*/" crashes PHP/Apache
request.

Referring to the source code, a string length greater than 376 character
crashes the request.

Rolling back to PHP 5.1.2, using PCRE 6.2 works correctly without crashing
for string lengths greater than 376 characters.

The bug is very similar to the following PHP bug report:

http://bugs.php.net/bug.php?id=24460

Reproduce code:
---------------
<?PHP

$test = str_repeat('a',377);

// preg_match() will crash the request
preg_match('/(\r|\n|.)*/',$test);

?>

Expected result:
----------------
The script to end gracefully.

Actual result:
--------------
Crashing of the PHP request.

-- 
Edit bug report at http://bugs.php.net/?id=38512&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=38512&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=38512&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=38512&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=38512&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=38512&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=38512&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=38512&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=38512&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=38512&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=38512&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=38512&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=38512&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=38512&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=38512&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=38512&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=38512&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=38512&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=38512&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=38512&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=38512&r=mysqlcfg

Reply via email to