Ask a Question related to PHP Bugs, Design and Development.
-
askold2 at velo dot nsk dot ru #1
#40706 [NEW]: preg_match crash
From: askold2 at velo dot nsk dot ru
Operating system: any
PHP version: 4.4.6
PHP Bug Type: PCRE related
Bug description: preg_match crash
Description:
------------
the regular expression like ((any text)*(other text)*)* produce the hang
or crash of PHP program. In the previous versions of php all worked
properly.
Reproduce code:
---------------
$subj="sdfgsdg";
if(preg_match('/^((a)*(b)*)*$/',$subj))
echo "match";
else
echo "not match";
Expected result:
----------------
"match" or "not match" printing
Actual result:
--------------
nothing. the hung of script on my unux hosting and breaking program in
windows
--
Edit bug report at [url]http://bugs.php.net/?id=40706&edit=1[/url]
--
Try a CVS snapshot (PHP 4.4): [url]http://bugs.php.net/fix.php?id=40706&r=trysnapshot44[/url]
Try a CVS snapshot (PHP 5.2): [url]http://bugs.php.net/fix.php?id=40706&r=trysnapshot52[/url]
Try a CVS snapshot (PHP 6.0): [url]http://bugs.php.net/fix.php?id=40706&r=trysnapshot60[/url]
Fixed in CVS: [url]http://bugs.php.net/fix.php?id=40706&r=fixedcvs[/url]
Fixed in release: [url]http://bugs.php.net/fix.php?id=40706&r=alreadyfixed[/url]
Need backtrace: [url]http://bugs.php.net/fix.php?id=40706&r=needtrace[/url]
Need Reproduce Script: [url]http://bugs.php.net/fix.php?id=40706&r=needscript[/url]
Try newer version: [url]http://bugs.php.net/fix.php?id=40706&r=oldversion[/url]
Not developer issue: [url]http://bugs.php.net/fix.php?id=40706&r=support[/url]
Expected behavior: [url]http://bugs.php.net/fix.php?id=40706&r=notwrong[/url]
Not enough info: [url]http://bugs.php.net/fix.php?id=40706&r=notenoughinfo[/url]
Submitted twice: [url]http://bugs.php.net/fix.php?id=40706&r=submittedtwice[/url]
register_globals: [url]http://bugs.php.net/fix.php?id=40706&r=globals[/url]
PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=40706&r=php3[/url]
Daylight Savings: [url]http://bugs.php.net/fix.php?id=40706&r=dst[/url]
IIS Stability: [url]http://bugs.php.net/fix.php?id=40706&r=isapi[/url]
Install GNU Sed: [url]http://bugs.php.net/fix.php?id=40706&r=gnused[/url]
Floating point limitations: [url]http://bugs.php.net/fix.php?id=40706&r=float[/url]
No Zend Extensions: [url]http://bugs.php.net/fix.php?id=40706&r=nozend[/url]
MySQL Configuration Error: [url]http://bugs.php.net/fix.php?id=40706&r=mysqlcfg[/url]
askold2 at velo dot nsk dot ru Guest
-
InDesign CS CE non-stop CRASH, CRASH, CRASH, CRASH, CRASH, CRASH
Sofware is orig., and OS is win2000 pro, or 2003 server or win2000 server. Any doc with litle more text crash indesign non-stop. With any updates... -
preg_match
Hello, I would like to split a String containing ingredience with additional assigned footnotes... my problem I only get the first ingredience... -
preg_match allowing a-z AND å ä ö ü
I've been searching the net and Google news groups for a preg_match expression that will return true on strings containing (uppercase and... -
preg_match VS preg_match_all
I'm wondering if someone can explain why the following works with preg_match_all, but not preg_match: $html = "product=3456789&" ... -
preg_match bug
Hey I wanted to see if anyone was getting the same problem. Using preg_match in the following pattern: "/<tr bgcolor="#FFFFFF">(.|\n)+?<\/tr>/" ... -
bmihelac at mihelac dot org #2
#40706 [Com]: preg_match crash
ID: 40706
Comment by: bmihelac at mihelac dot org
Reported By: askold2 at velo dot nsk dot ru
Status: Open
Bug Type: PCRE related
Operating System: any
PHP Version: 4.4.6
New Comment:
I have similiar problem both on linux and windows. On windows it
crashes PHP without any error notices. I am not sure if it crash PHP on
linux/unix.
Seems that regex with nested parenthesizes are especially vunerable,
for example:
$pattern = '/"([^"\\\\]*(?:(?:\\\\.)*[^"\\\\]*)*)"/';
Previous Comments:
------------------------------------------------------------------------
[2007-03-03 15:12:45] askold2 at velo dot nsk dot ru
Description:
------------
the regular expression like ((any text)*(other text)*)* produce the
hang or crash of PHP program. In the previous versions of php all
worked properly.
Reproduce code:
---------------
$subj="sdfgsdg";
if(preg_match('/^((a)*(b)*)*$/',$subj))
echo "match";
else
echo "not match";
Expected result:
----------------
"match" or "not match" printing
Actual result:
--------------
nothing. the hung of script on my unux hosting and breaking program in
windows
------------------------------------------------------------------------
--
Edit this bug report at [url]http://bugs.php.net/?id=40706&edit=1[/url]
bmihelac at mihelac dot org Guest
-
tony2001@php.net #3
#40706 [Opn->Bgs]: preg_match crash
ID: 40706
Updated by: [email]tony2001@php.net[/email]
Reported By: askold2 at velo dot nsk dot ru
-Status: Open
+Status: Bogus
Bug Type: PCRE related
Operating System: any
PHP Version: 4.4.6
New Comment:
We can't fix PCRE stack overflow (it's not PHP problem anyway), but we
have a workaround for it in PHP5.
Please consider upgrading.
Previous Comments:
------------------------------------------------------------------------
[2007-03-04 13:47:46] bmihelac at mihelac dot org
I have similiar problem both on linux and windows. On windows it
crashes PHP without any error notices. I am not sure if it crash PHP on
linux/unix.
Seems that regex with nested parenthesizes are especially vunerable,
for example:
$pattern = '/"([^"\\\\]*(?:(?:\\\\.)*[^"\\\\]*)*)"/';
------------------------------------------------------------------------
[2007-03-03 15:12:45] askold2 at velo dot nsk dot ru
Description:
------------
the regular expression like ((any text)*(other text)*)* produce the
hang or crash of PHP program. In the previous versions of php all
worked properly.
Reproduce code:
---------------
$subj="sdfgsdg";
if(preg_match('/^((a)*(b)*)*$/',$subj))
echo "match";
else
echo "not match";
Expected result:
----------------
"match" or "not match" printing
Actual result:
--------------
nothing. the hung of script on my unux hosting and breaking program in
windows
------------------------------------------------------------------------
--
Edit this bug report at [url]http://bugs.php.net/?id=40706&edit=1[/url]
tony2001@php.net Guest



Reply With Quote

