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 d8a82bb..d0b01ea 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 4033b9f..c691842 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))) {