From:             peter at normann dot com
Operating system: Linux kernel 2.5.74
PHP version:      4.3.4
PHP Bug Type:     Regexps related
Bug description:  Segmentation fault using regexp in php versions later than 4.3.3RC1

Description:
------------
php crashes when using the preg_match function. Code included below. Works
in php4.3.3RC1 but any later version causes segmentation fault.

The code is part of a text filter.

$output contains text with plain text and html mixed. The idea is anything
between [html] and [/html] will go untouched by the filter.

I use dozens of other regular expressions, but preg_match is a sure
killer. I can easily reproduce this behavior.



Reproduce code:
---------------
while (preg_match('/\[html]((.|\s)+?)\[\/html]/', $output, $htmlshow))
$output = str_replace($htmlshow[0], str_replace('<br />', '',
strtr($htmlshow[1],
array_flip(get_html_translation_table(HTML_ENTITIES)))), $output);

Actual result:
--------------
child pid xxxxx exit signal Segmentation fault (11)



-- 
Edit bug report at http://bugs.php.net/?id=26219&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=26219&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=26219&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=26219&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=26219&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=26219&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=26219&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=26219&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=26219&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=26219&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=26219&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=26219&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26219&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=26219&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=26219&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=26219&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=26219&r=float

Reply via email to