|  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
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.
Block user comment
Status: Assign to:
Bug Type:
From: jambozx at gmail dot com
New email:
PHP Version: OS:


 [2016-04-17 11:07 UTC] jambozx at gmail dot com
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:
$c = curl_init();
print "1";
curl_setopt($c, CURLOPT_HTTPHEADER, []);

Expected result:

Actual result:
1Segmentation fault


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-04-17 11:23 UTC]
-Status: Open +Status: Feedback
 [2016-04-17 11:23 UTC]
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 for *NIX and 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-2023 The PHP Group
All rights reserved.
Last updated: Sun Sep 24 21:01:24 2023 UTC