php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63840 preg_peplace crash
Submitted: 2012-12-23 16:19 UTC Modified: 2012-12-23 16:26 UTC
From: DuMOHsmol at yandex dot ru Assigned:
Status: Not a bug Package: *Regular Expressions
PHP Version: 5.3Git-2012-12-23 (snap) OS: Windows
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: DuMOHsmol at yandex dot ru
New email:
PHP Version: OS:

 

 [2012-12-23 16:19 UTC] DuMOHsmol at yandex dot ru
Description:
------------
Hello, this code crashes Apache with PHP on Windows. I know that this regex is not quite correct, but still.

The solution is to increase Apache stack, but I think there should be some check in PHP to prevent crashing.

Test script:
---------------
$text = '
test_test_test_test_test_test_test_test_test_test_test_test_test_test_test
test_test_test_test_test_test_test_test_test_test_test_test_test_test_test
test_test_test_test_test_test_test_test_test_test_test_test_test_test_test
test_test_test_test_test_test_test_test_test_test_test_test_test_test_test
test_test_test_test_test_test_test_test_test_test_test_test_test_test_test
test_test_test_test_test_test_test_test_test_test_test_test_test_test_test
test_test_test_test_test_test_test_test_test_test_test_test_test_test_test
test_test_test_test_test_test_test_test_test_test_test_test_test_test_test
test_test_test_test_test_test_test_test_test_test_test_test_test_test_test
';

$text = preg_replace('/([\n]|.)*/','test',$text);

echo $text;


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-12-23 16:26 UTC] felipe@php.net
See bug #63829
 [2012-12-23 16:26 UTC] felipe@php.net
-Status: Open +Status: Not a bug
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Dec 11 00:01:28 2024 UTC