php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23706 fopen on a http url crashes php process
Submitted: 2003-05-19 16:30 UTC Modified: 2003-05-26 13:28 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: rasmus dot watjen at rassie dot dk Assigned:
Status: Closed Package: Reproducible crash
PHP Version: 4.3.1 OS: windows 2000/xp
Private report: No CVE-ID: None
 [2003-05-19 16:30 UTC] rasmus dot watjen at rassie dot dk
Using the Windows 4.3.1 CGI binary under apache 1.3.27 and IIS 5.0, the fopen function crashes when used with a HTTP URL that 404's and is more than 30 characters in the path part of the URL. When the path part is 30 or less characters it doesn't seem to crash.
It has done this on two machines running Windows XP with Apache 1.3.27 and one machine running Windows 2000 with IIS5.

The following will crash the apache process handling the php script:

function readDataFromURL($url) {
  $fp = @fopen($url, "rb");
  if ($fp) {
    $data = "";
    $buffersize = 1024;
    while (!feof($fp)) {
      $thisdata = fread($fp, $buffersize);
      $data .= $thisdata;
    }
		
    return $data;
  } else {
    return false;
  }
}

$url = "http://127.0.0.1/asdfasdfasdfasdfasdfasdfasdfasd";
readDataFromURL($url);

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-05-24 01:21 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.


 [2003-05-26 13:28 UTC] rasmus dot watjen at rassie dot dk
Unable to reproduce problem with php 4.3.2 RC4.
Changing status to closed.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Oct 07 11:00:02 2026 UTC