#23706 [NEW]: fopen on a http url crashes php process
| From: | rasmus dot watjen at rassie dot dk | Date: | Mon, 19 May 2003 21:30:29 +0000 |
| Subject: | #23706 [NEW]: fopen on a http url crashes php process | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-39992@lists.php.net to get a copy of this message | ||
From: rasmus dot watjen at rassie dot dk
Operating system: windows 2000/xp
PHP version: 4.3.1
PHP Bug Type: Reproducible crash
Bug description: fopen on a http url crashes php process
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);
--
Edit bug report at http://bugs.php.net/?id=23706&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=23706&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=23706&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=23706&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=23706&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=23706&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=23706&r=support
Expected behavior: http://bugs.php.net/fix.php?id=23706&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=23706&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=23706&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=23706&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=23706&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=23706&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=23706&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=23706&r=gnused