php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72042 curl_setopt($c, CURLOPT_HTTPHEADER, []); causes segfault
Submitted: 2016-04-17 11:07 UTC Modified: 2016-05-01 04:22 UTC
Votes:4
Avg. Score:2.8 ± 1.1
Reproduced:4 of 4 (100.0%)
Same Version:2 (50.0%)
Same OS:4 (100.0%)
From: jambozx at gmail dot com Assigned:
Status: No Feedback Package: cURL related
PHP Version: 7.0.5 OS: Debian 7/wheezy
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: jambozx at gmail dot com
New email:
PHP Version: OS:

 

 [2016-04-17 11:07 UTC] jambozx at gmail dot com
Description:
------------
Passing an empty array as the third parameter of curl_setopt() when the second parameter is CURLOPT_HTTPHEADER causes a segmentation fault. Also when a variable with value [] is passed to it.

My cURL version is 7.48.0 and had the same problem with a much older cURL.

Test script:
---------------
<?php
$c = curl_init();
print "1";
curl_setopt($c, CURLOPT_HTTPHEADER, []);
die("done");

Expected result:
----------------
1done

Actual result:
--------------
1Segmentation fault

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-04-17 11:23 UTC] requinix@php.net
-Status: Open +Status: Feedback
 [2016-04-17 11:23 UTC] requinix@php.net
Thank you for this bug report. To properly diagnose the problem, 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 for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.

(duplicate of bug #71703, but that NoF-ed)
 [2016-05-01 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Jul 04 00:01:26 2020 UTC