Bug #15989 Updated: php is segfaulting when trying to read http header of a ftp.domaine.com site

From: Date: Mon, 11 Mar 2002 10:42:55 +0000
Subject: Bug #15989 Updated: php is segfaulting when trying to read http header of a ftp.domaine.com site
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-2195@lists.php.net to get a copy of this message
ID: 15989 Updated by: sander@php.net Reported By: dams@php.net -Status: Open +Status: Feedback Bug Type: cURL related Operating System: windows 2000, macosx PHP Version: 4.1.2 New Comment: 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". Previous Comments: ------------------------------------------------------------------------ [2002-03-10 21:06:57] 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. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=15989&edit=1

« previous php.bugs (#2195) next »