Fix a rare crash with unitialized CURLOPT_HTTPHEADER
authorMichael Wallner <mike@php.net>
Fri, 17 Jan 2014 14:41:02 +0000 (15:41 +0100)
committerMichael Wallner <mike@php.net>
Fri, 17 Jan 2014 14:41:02 +0000 (15:41 +0100)
package.xml
php_http_client_curl.c

index d8a82bb152db247438735ac9d20f7e4c17d1b24a..d0b01ea0467e536f3d62d015ab4f053c432347b2 100644 (file)
@@ -48,7 +48,7 @@ v2: http://dev.iworks.at/ext-http/lcov/ext/http/
  </stability>
  <license>BSD, revised</license>
  <notes><![CDATA[
-*
+* Fix rare crash with uninitialized CURLOPT_HTTPHEADER
 ]]></notes>
  <contents>
   <dir name="/">
index 4033b9f56c5c0c61a36b19ae4475d5e9edb50f19..c6918426264ea3fa32df358a5f208c2ba14d63b5 100644 (file)
@@ -1492,8 +1492,8 @@ static STATUS php_http_client_curl_handler_prepare(php_http_client_curl_handler_
                        }
                }
                php_http_buffer_dtor(&header);
-               curl_easy_setopt(curl->handle, CURLOPT_HTTPHEADER, curl->options.headers);
        }
+       curl_easy_setopt(curl->handle, CURLOPT_HTTPHEADER, curl->options.headers);
 
        /* attach request body */
        if ((body_size = php_http_message_body_size(msg->body))) {