#41050 [NEW]: Segmentation fault using preg_match (any PCRE matching)
| From: | legolas558 at users dot sourceforge dot net | Date: | Wed, 11 Apr 2007 10:51:28 +0000 |
| Subject: | #41050 [NEW]: Segmentation fault using preg_match (any PCRE matching) | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-111333@lists.php.net to get a copy of this message | ||
From: legolas558 at users dot sourceforge dot net
Operating system: Windows XP SP2
PHP version: 4.4.6
PHP Bug Type: PCRE related
Bug description: Segmentation fault using preg_match (any PCRE matching)
Description:
------------
I have tested the below script with PHP 4.4.4.4 and there was no problem;
now with PHP 4.4.6 there is a crash (probably a segmentation fault) and a
server error (500) is returned. I could not provide a win32 backtrace
however you can easily generate it using the testcase.
Reproduce code:
---------------
<?php
// by legolas558
$regex =
'/(insert|drop|create|select|delete|update)([^;\']*('."('[^']*')+".')?)*(;|$)/i';
$sql = 'SELECT * FROM #__components';
//$sql = ''; // does not cause error
if (preg_match($regex,$sql, $m)) echo 'matched';
else echo 'not matched';
?>
Expected result:
----------------
matched
Actual result:
--------------
CGI Error
The specified CGI application misbehaved by not returning a complete set
of HTTP headers. The headers it did return are:
--
Edit bug report at http://bugs.php.net/?id=41050&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41050&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41050&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41050&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=41050&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=41050&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=41050&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=41050&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=41050&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=41050&r=support
Expected behavior: http://bugs.php.net/fix.php?id=41050&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=41050&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=41050&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=41050&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41050&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=41050&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=41050&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=41050&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=41050&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=41050&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=41050&r=mysqlcfg