php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15989 php is segfaulting when trying to read http header of a ftp.domaine.com site
Submitted: 2002-03-10 21:06 UTC Modified: 2002-07-25 21:57 UTC
From: dams@php.net Assigned:
Status: Closed Package: cURL related
PHP Version: 4.1.2 OS: windows 2000, macosx
Private report: No CVE-ID: None
 [2002-03-10 21:06 UTC] dams@php.net
Here is a simple code for this : 
<?php
curl_setopt($ch, CURLOPT_URL, "ftp.dds.be"); // this is an 
example
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt ($ch, CURLOPT_HEADER, 1);
curl_setopt ($ch, CURLOPT_NOBODY, 1);
curl_setopt ($ch, CURLOPT_TIMEOUT, 5);

print "OK until now\n";
var_dump( $retour = curl_exec ($ch));
?>

When the protocol is not specified, and the host name 
starts with ftp., there is a conflict segfault.
It seems to have a conflict where curl choose automatically 
ftp protocole for ftp.*.* sites, but the script ask for 
http header. Then php crashes.

This has been found with PHP 4.1.0/4.1.1 for windows, and 
PHP 4.1.2/ curl 7.9.4

PHP should return an error, but not crash. Note that when 
specifying the protocol, (eg, "http://ftp.site.com"), it 
works fine.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-03-11 05:42 UTC] sander@php.net
To properly diagnose this bug, we need a backtrace to see what is
happening behind the scenes. To find out how to generate a backtrace,
please read http://bugs.php.net/bugs-generating-backtrace.php

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open".


 [2002-06-10 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2002-06-10 02:18 UTC] mfischer@php.net
Dams you bad boy, give us the feedback ;-) Please also try CVS HEAD while you're at it, thx.
 [2002-07-12 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2002-07-25 21:57 UTC] dams@php.net
This bug has been fixed in CVS. You can grab a snapshot of the
CVS version at http://snaps.php.net/. In case this was a documentation 
problem, the fix will show up soon at http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites.
Thank you for the report, and for helping us make PHP better.

Markus, Honey,

I tried this baby with PHP 4.3.0 (21rst july snapshot) on 
MacOSX, and it is now closed. Good job.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 08:01:30 2024 UTC