php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1035 ereg_replace() causes segmentation fault in Apache+mod_ssl
Submitted: 1999-01-06 16:07 UTC Modified: 1999-04-19 04:47 UTC
From: danbeck at mtginfo dot com Assigned:
Status: Closed Package: Reproducible Crash
PHP Version: 3.0.5 OS: RedHat Linux 5.2
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: danbeck at mtginfo dot com
New email:
PHP Version: OS:

 

 [1999-01-06 16:07 UTC] danbeck at mtginfo dot com
After using the apxs utility that comes with Apache to reconfigure and install PHP3 3.0.5 as a DSO, I attempted to access a script that was previously working on the same machine.  By eliminating a line of code at a time, It seems that the ereg_replace function in the code snippit below is causing the problem.  If I comment that line out, my script works just fine, if I leave it in, it causes Apache to report and Segmentation Fault and IE4 tells me that the server returned an invalid response.

<?
 $fp = fopen($dat_file_name, "r");
 $count = -1;
 while(!feof($fp)) {
   $data = explode(":", fgets($fp, 1024));
   // chomp
   $data[0] = chop($data[0]);
   $data[1] = ereg_replace( "\n", "", $data[1] );

   $tmp_array[$data[0]] = $data[1];

 }
 fclose($fp); 

?>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-04-19 04:47 UTC] rasmus
This is because the RH Apache RPM disables hsregex and PHP's configure mechanism wasn't smart enough to detect this.  As of 3.0.8 it will be, but for now either use the Apache-1.3.6 RPM from http://www.lerdorf.on.ca/apache/ or configure php using --with-system-regex
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 06 06:01:34 2025 UTC