php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23053 preg_match cause PHP overload the CPU
Submitted: 2003-04-04 09:09 UTC Modified: 2003-04-09 06:38 UTC
From: php at soundofos dot demon dot nl Assigned:
Status: No Feedback Package: PCRE related
PHP Version: 4.3.1 OS: windows 2000
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: php at soundofos dot demon dot nl
New email:
PHP Version: OS:

 

 [2003-04-04 09:09 UTC] php at soundofos dot demon dot nl
According to the documenmtation,preg_match can handle Arrays
But this will cause PHP to lock up the computer.

$regExp = "/((\/\*)+([\*]*\s*)+(\w+ *)+([\*]\s*(\*+\/{1}))+){1}/";
$file = file($obj->fileLocation);
$sql = preg_replace($regExp,"",$file);
I have tried imploding the array obtained from file() first
but the result was the same.

Maybe i should mention that PHP is running in CGI mode.

regards,

Ed Hofrichter

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-04-04 10:51 UTC] sniper@php.net
Please provide a self-contained example script.
(tested your script with using some random file and it works just fine)

 [2003-04-09 06:38 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 10:01:29 2024 UTC