php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58491 HttpRequest::resetCookies segfaults when passing an integer
Submitted: 2009-01-04 09:32 UTC Modified: 2009-02-16 10:49 UTC
From: felipe@php.net Assigned: mike (profile)
Status: Wont fix Package: pecl_http (PECL)
PHP Version: 5_3 CVS-2009-01-04 (dev) OS:
Private report: No CVE-ID: None
 [2009-01-04 09:32 UTC] felipe@php.net
Description:
------------
See below.

Reproduce code:
---------------
$x = new HttpRequest; $x->resetCookies(1);

Expected result:
----------------
Nothing.

Actual result:
--------------
Starting program: /home/felipe/dev/php5/sapi/cli/php -r '$x = new HttpRequest; $x->resetCookies(1);'
[Thread debugging using libthread_db enabled]
[New Thread 0xb79066b0 (LWP 9307)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb79066b0 (LWP 9307)]
0xb7dc31fb in Curl_cookie_clearsess (cookies=0x0) at cookie.c:877
877	  if(!cookies->cookies)
(gdb) bt
#0  0xb7dc31fb in Curl_cookie_clearsess (cookies=0x0) at cookie.c:877
#1  0xb7dd4908 in Curl_setopt (data=0xa32b7c8, option=CURLOPT_COOKIELIST, 
    param=0xbffe6a38 "��v\b\002CA\b\034�+\n") at url.c:1257
#2  0xb7de0bf4 in curl_easy_setopt (curl=0x0, tag=CURLOPT_COOKIELIST)
    at easy.c:392
#3  0x08383575 in _http_request_reset_cookies (request=0xa2be0d8, 
    session_only=1) at /home/felipe/dev/php5/ext/http/http_request_api.c:405
#4  0x08373b0b in zim_HttpRequest_resetCookies (ht=1, return_value=0xa2be9e8, 
    return_value_ptr=0x0, this_ptr=0xa2bd34c, return_value_used=0, 
    tsrm_ls=0xa146070)
    at /home/felipe/dev/php5/ext/http/http_request_object.c:1056
#5  0x08472e47 in zend_do_fcall_common_helper_SPEC (execute_data=0xa2eb63c, 
    tsrm_ls=0xa146070) at /home/felipe/dev/php5/Zend/zend_vm_execute.h:313
#6  0x08473fc6 in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (execute_data=0xa2eb63c, 
    tsrm_ls=0xa146070) at /home/felipe/dev/php5/Zend/zend_vm_execute.h:422
#7  0x08471c08 in execute (op_array=0xa2bda48, tsrm_ls=0xa146070)
    at /home/felipe/dev/php5/Zend/zend_vm_execute.h:104
#8  0x08431c17 in zend_eval_string (


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-01-13 05:07 UTC] mike@php.net
This happens when you call resetCookies with any parameter evaluation to true (clear session cookies).

Seems like a bug in libcurl, patch has been sent to maintainer.

Thanks.
 [2009-02-16 10:49 UTC] mike@php.net
Patch has been released with 7.19.3 on January 19 2009
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 11:01:30 2024 UTC