From:             kenorb at gmail dot com
Operating system: Windows7
PHP version:      5.2.9
PHP Bug Type:     Reproducible crash
Bug description:  Connection Interrupted after invalid preg_match_all

Description:
------------
Following code crashing whole website.
A could reproduce it with php5.2.9-1 on Win7 (using WAMP).
I couldn't on 5.2.6 on FreeBSD configuration.


Reproduce code:
---------------
$data = "; \$Id: administerusersbyrole.info,v 1.1.2.1 2009/01/27 20:40:40
smokris Exp \$\nname = Administer Users by Role\ndescription = \"Allows
users with 'administer users' permission and a role (specified in
'Permissions') to edit/delete other users with a specified role.  If the
user being edited has multiple roles, the user doing the editing must have
permission to edit ALL of the user being edited's roles.  Also provides
control over user creation.  Works well in conjunction with <a
href='http://drupal.org/project/role_delegation'>role_delegation</a>.\"\ncore
= 6.x\n\n; Information added by drupal.org packaging script on
2009-01-28\nversion = \"6.x-1.3\"\ncore = \"6.x\"\nproject =
\"administerusersbyrole\"\ndatestamp = \"1233114605\"\n\n";
preg_match_all('
    @^\s*                           # Start at the beginning of a line,
ignoring leading whitespace
    ((?:
      [^=;\[\]]|                    # Key names cannot contain equal
signs, semi-colons or square brackets,
      \[[^\[\]]*\]                  # unless they are balanced and not
nested
    )+?)
    \s*=\s*                         # Key/value pairs are separated by
equal signs (ignoring white-space)
    (?:
      ("(?:[^"]|(?<=\\\\)")*")|     # Double-quoted string, which may
contain slash-escaped quotes/slashes
      (\'(?:[^\']|(?<=\\\\)\')*\')| # Single-quoted string, which may
contain slash-escaped quotes/slashes
      ([^\r\n]*?)                   # Non-quoted string
    )\s*$                           # Stop at the next end of a line,
ignoring trailing whitespace
    @msx', $data, $matches, PREG_SET_ORDER);


Expected result:
----------------
Continue execution.

Actual result:
--------------
On Firefox: Connection Interrupted
On Chrome: Error 101 (net::ERR_CONNECTION_RESET): Unknown error.


-- 
Edit bug report at http://bugs.php.net/?id=48347&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        
http://bugs.php.net/fix.php?id=48347&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        
http://bugs.php.net/fix.php?id=48347&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        
http://bugs.php.net/fix.php?id=48347&r=trysnapshot60
Fixed in CVS:                        
http://bugs.php.net/fix.php?id=48347&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=48347&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=48347&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=48347&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=48347&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=48347&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=48347&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=48347&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=48347&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=48347&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=48347&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=48347&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=48347&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=48347&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=48347&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=48347&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=48347&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=48347&r=mysqlcfg

Reply via email to