From:             vr...@php.net
Operating system: Windows
PHP version:      5.2.9
PHP Bug Type:     PCRE related
Bug description:  Apache crash with certain regular expression

Description:
------------
Apache 2.2.11 crashes with PHP 5.2.9-1 on the following code. The same
script run from CLI executes without crash.

Reproduce code:
---------------
<?php
$contents = '/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */';
// shortest possible example, omitting last line causes no crash

$contents = preg_replace('@/\\*(?:.|[\\n\\r])*?\\*/@', '', $contents);
?>


Expected result:
----------------
Empty string in $contents.

Actual result:
--------------
Apache crash.

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

Reply via email to