|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-03-24 17:46 UTC] adrynet at tiscali dot it
Description:
------------
Good morning,
executing preg_match_all() function with this Regular Expression causes a PHP Segmentation Fault.
The following code works correctly both with previous versions of PHP and PHP 5.2.1.
Thank you for support
Adriano C.
Reproduce code:
---------------
<?php
$pattern = "/\s([\w_\.\/]+)(?:=([\'\"]?(?:[\w\d\s\?=\(\)\.,'_#\/\\:;&-]|(?:\\\\\"|\\\')?)+[\'\"]?))?/";
$context = "<simpletag an_attribute=\"simpleValueInside\">";
$match = array();
if ($result =preg_match_all($pattern, $context, $match))
{
var_dump($result);
}
?>
Expected result:
----------------
int(1)
Actual result:
--------------
Segmentation Fault
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 08:00:01 2025 UTC |
reproducible with CVS 5_2 too. gdb --args ./sapi/cli/php ~/preg.php (gdb) run Starting program: /home/cristian/php5/sapi/cli/php /home/cristian/preg.php Program received signal SIGSEGV, Segmentation fault. 0x0000000000453d2d in match (eptr=Cannot access memory at address 0x7fff5c974b60 ) at /home/cristian/php5/ext/pcre/pcrelib/pcre_exec.c:372 372 { (gdb) bt full #0 0x0000000000453d2d in match (eptr=Cannot access memory at address 0x7fff5c974b60 ) at /home/cristian/php5/ext/pcre/pcrelib/pcre_exec.c:372 rrc = Cannot access memory at address 0x7fff5c974c48 (gdb)