php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12695 curl_exec crashes when using CURLOPT_WRITEHEADER
Submitted: 2001-08-10 16:06 UTC Modified: 2001-08-10 17:17 UTC
From: victor at lab dot de Assigned:
Status: Not a bug Package: cURL related
PHP Version: 4.0.6 OS: Debian GNU Linux 2.2r3/2.2.19
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: victor at lab dot de
New email:
PHP Version: OS:

 

 [2001-08-10 16:06 UTC] victor at lab dot de
A cURL session will crash during execution with curl_exec,
if the option CURLOPT_WRITEHEADER has been used before with
curl_setopt. The following snippet crashes reproducably:

<?
	$ch = curl_init('http://www.php.net/');
	$fh = fopen('/tmp/header.log', 'w');
	curl_setopt ($ch, CURLOPT_WRITEHEADER, $fh);
	curl_exec($ch);
?>

with the following gdb backtrace:
#0  0x806cb15 in curl_write (data=0x818af00 "HTTP/1.1 200 OK\r\n", size=1, nmemb=17, ctx=0x818b170) at curl.c:257
#1  0x2ab0e33e in Curl_client_write (data=0x818b9b0, type=2, ptr=0x818af00 "HTTP/1.1 200 OK\r\n", len=17) at sendf.c:241
#2  0x2ab1ae8f in Transfer (c_conn=0x818b2b8) at transfer.c:616
#3  0x2ab1b7b2 in Curl_perform (curl=0x818b9b0) at transfer.c:873
#4  0x2ab1bae2 in curl_easy_perform (curl=0x818b9b0) at easy.c:163
#5  0x806e43a in php_if_curl_exec (ht=1, return_value=0x818669c, this_ptr=0x0, return_value_used=0) at curl.c:772
#6  0x80feeff in execute (op_array=0x8186754) at ./zend_execute.c:1504
#7  0x80db8cb in zend_execute_scripts (type=8, file_count=3) at zend.c:752
#8  0x8064334 in php_execute_script (primary_file=0x7ffffc88) at main.c:1206
#9  0x806294c in main (argc=2, argv=0x7ffffd04) at cgi_main.c:718

my --configure is:
./configure' '--
prefix=/usr/local/php' '--with-config-file-path=/usr/local/php/etc' '--with-gd=shared' '--with-curl=/usr/local/curl' '--disable-pear
' '--disable-debug' '--disable-static' '--enable-session' '--with-bz2' '--with-zlib' '--with-pcre-regex=/usr' '--with-regex=system'
'--with-ldap=shared,/usr' '--enable-ftp' '--with-openssl' '--enable-sockets' '--with-snmp=shared' '--enable-ucd-snmp-hack'

snmp and ldap modules were _not_ loaded at run time. The
crash occures in both, the CGI version and httpd (--with-apxs).

Regards
Victor


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-08-10 17:17 UTC] sniper@php.net
submitted twice.

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jan 02 12:01:29 2025 UTC