php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11287 CURLOPT_WRITEHEADER crashes PHP
Submitted: 2001-06-05 10:30 UTC Modified: 2001-07-02 08:07 UTC
From: alberty at neptunlabs dot de Assigned:
Status: Closed Package: cURL related
PHP Version: 4.0 Latest CVS (22/6 2001) OS: i686-pc-linux-gnu
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: alberty at neptunlabs dot de
New email:
PHP Version: OS:

 

 [2001-06-05 10:30 UTC] alberty at neptunlabs dot de
in PHP-4.0.6RC2(&RC1) scripts crashes if you use in cURL the CURLOPT_WRITEHEADER option.

in php-4.0.4pl1 it works correct...


eg.:
$ch = curl_init ("http://foo.bar.com");
$header_file = fopen ("header_curl.dat", "w");
curl_setopt ($ch, CURLOPT_WRITEHEADER, $header_file);
$result=curl_exec ($ch);
if ($header_file) fclose ($header_file);

-- 
Steve

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-22 12:52 UTC] sniper@php.net
Crashes with latest CVS, GDB backtrace:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (runnable)]
0x406b441a in curl_write (data=0x832a218 "HTTP/1.1 200 OK\r\n", size=1, nmemb=17, ctx=0x832a548) at curl.c:259
259             php_curl_write *t      = ch->handlers->write;
(gdb) bt
#0  0x406b441a in curl_write (data=0x832a218 "HTTP/1.1 200 OK\r\n", size=1, nmemb=17, ctx=0x832a548) at curl.c:259
#1  0x41405a68 in Curl_client_write (data=0x832ad88, type=2, ptr=0x832a218 "HTTP/1.1 200 OK\r\n", len=17)
    at sendf.c:246
#2  0x414122db in Transfer (c_conn=0x83256c0) at transfer.c:616
#3  0x41412c94 in Curl_perform (curl=0x832ad88) at transfer.c:873
#4  0x41412fd2 in curl_easy_perform (curl=0x832ad88) at easy.c:151
#5  0x406b64ce in php_if_curl_exec (ht=1, return_value=0x832ad6c, this_ptr=0x0, return_value_used=1) at curl.c:794
#6  0x4066b477 in execute (op_array=0x832549c) at ./zend_execute.c:1554
#7  0x4067bf50 in zend_execute_scripts (type=8, file_count=3) at zend.c:750
#8  0x40694fa3 in php_execute_script (primary_file=0xbffff54c) at main.c:1265
#9  0x406902ce in apache_php_module_main (r=0x832008c, display_source_mode=0) at sapi_apache.c:90
#10 0x40691079 in send_php (r=0x832008c, display_source_mode=0, filename=0x8321b04 "/www/apache/htdocs/curl.php")
    at mod_php4.c:581
#11 0x406910c2 in send_parsed_php (r=0x832008c) at mod_php4.c:594
#12 0x80554f9 in ap_invoke_handler () at md4.c:255
#13 0x806a44f in process_request_internal () at md4.c:255
#14 0x806a4ba in ap_process_request () at md4.c:255
#15 0x8061306 in child_main () at md4.c:255
#16 0x80614e1 in make_child () at md4.c:255
#17 0x806165c in startup_children () at md4.c:255
#18 0x8061ccc in standalone_main () at md4.c:255
#19 0x806251c in main () at md4.c:255
#20 0x400d6c03 in __libc_start_main (main=0x8062164 <main>, argc=2, argv=0xbffff81c, init=0x804f3e0 <_init>, 
    fini=0x8099f94 <_fini>, rtld_fini=0x4000bbc0 <_dl_fini>, stack_end=0xbffff814)
    at ../sysdeps/generic/libc-start.c:92

 [2001-07-02 08:07 UTC] sterling@php.net
Fixed in CVS.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Tue Mar 31 14:01:23 2020 UTC