#41050 [Opn->Fbk]: Segmentation fault using preg_match (any PCRE matching)

From: Date: Wed, 11 Apr 2007 11:13:13 +0000
Subject: #41050 [Opn->Fbk]: Segmentation fault using preg_match (any PCRE matching)
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-111334@lists.php.net to get a copy of this message
ID: 41050 Updated by: derick@php.net Reported By: legolas558 at users dot sourceforge dot net -Status: Open +Status: Feedback Bug Type: PCRE related Operating System: Windows XP SP2 PHP Version: 4.4.6 New Comment: Please try using this CVS snapshot: http://snaps.php.net/php4-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-STABLE-latest.zip Previous Comments: ------------------------------------------------------------------------ [2007-04-11 10:51:28] legolas558 at users dot sourceforge dot net 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 this bug report at http://bugs.php.net/?id=41050&edit=1

« previous php.bugs (#111334) next »