|  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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
35 + 16 = ?
Subscribe to this entry?

 [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-2021 The PHP Group
All rights reserved.
Last updated: Fri Mar 05 01:01:23 2021 UTC