php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #977 php seems to crash with ereg and a searchstring including "?>"
Submitted: 1998-12-05 11:10 UTC Modified: 1998-12-05 17:03 UTC
From: auke at muze dot nl Assigned:
Status: Closed Package: Reproducible Crash
PHP Version: 3.0.5 OS: debian 2.0
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: auke at muze dot nl
New email:
PHP Version: OS:

 

 [1998-12-05 11:10 UTC] auke at muze dot nl
start<br>
<?php
  echo "in<br>";
  if (ereg("?>",$frut)) { echo "frut"; } else { echo "frot"; };
?>
end<br>

running this script resulted in a 'document contains no data' error and the following line in the error_log
 
[Sat Dec  5 17:03:13 1998] [notice] httpd: child pid 12871 exit signal Aborted (6) 

I'm not sure what happened here but it looks suspiciously like a crash :)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-12-05 17:03 UTC] zeev
This can result from several things.

First, the regular expression seems not to be valid.
For me, a regex error comes back:
<b>Warning</b>:  REG_BADRPT in <b>-</b> on line <b>2</b><br>

Your regex library may be less forgiving and crash.

Or, you may have the common regex messup where you compiled
Apache with one set of regex functions, and PHP with another.
Do all other regex's work fine?  If not, that's probably
your problem.

There's nothing special in PHP in the handling of the 
"?>" string, it's handled like any other string, and fed
as-is to the regex function.  If there's a crash in there,
it's definitely coming from the regex library.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 10:01:31 2024 UTC