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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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 18 03:01:28 2024 UTC