Bug #72042 [NEW]: curl_setopt($c, CURLOPT_HTTPHEADER, []); causes segfault

From: Date: Sun, 17 Apr 2016 11:07:11 +0000
Subject: Bug #72042 [NEW]: curl_setopt($c, CURLOPT_HTTPHEADER, []); causes segfault
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-200611@lists.php.net to get a copy of this message
From: jambozx at gmail dot com Operating system: Debian 7/wheezy PHP version: 7.0.5 Package: cURL related Bug Type: Bug Bug description:curl_setopt($c, CURLOPT_HTTPHEADER, []); causes segfault 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 -- Edit bug report at https://bugs.php.net/bug.php?id=72042&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=72042&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=72042&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=72042&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=72042&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=72042&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=72042&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=72042&r=needscript Try newer version: https://bugs.php.net/fix.php?id=72042&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=72042&r=support Expected behavior: https://bugs.php.net/fix.php?id=72042&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=72042&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=72042&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=72042&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=72042&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=72042&r=dst IIS Stability: https://bugs.php.net/fix.php?id=72042&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=72042&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=72042&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=72042&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=72042&r=mysqlcfg

« previous php.bugs (#200611) next »