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 Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or 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

Add a Patch

Pull Requests

Add a Pull Request

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: Thu Apr 25 21:01:36 2024 UTC