]> granicus.if.org Git - php/commitdiff
Fixed bug #71225 (curl_setopt() fails to set CURLOPT_POSTFIELDS with reference to...
authorXinchen Hui <laruence@gmail.com>
Sun, 27 Dec 2015 06:54:39 +0000 (22:54 -0800)
committerXinchen Hui <laruence@gmail.com>
Sun, 27 Dec 2015 06:55:38 +0000 (22:55 -0800)
NEWS
ext/curl/interface.c

diff --git a/NEWS b/NEWS
index 932dd4a251b5d53f92ea0aa3796b5ebf29243ac0..fdabff6af04fc7e6d125074444875a15da01e770 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,11 @@ PHP                                                                        NEWS
   . Fixed bug #71201 (round() segfault on 64-bit builds). (Anatol)
   . Added support for new HTTP 451 code. (Julien)
 
+- CURL:
+  . Fixed bug #71225 (curl_setopt() fails to set CURLOPT_POSTFIELDS with
+    reference to CURLFile). (Laruence)
+  
+
 - SPL:
   . Fixed bug #71204 (segfault if clean spl_autoload_funcs while autoloading).
     (Laruence)
index 7dd04a6d15f5bbdb75b3907df72e31c342d9ed09..8ab850faaa9c042753a2a15bf91c5e347ab25716 100644 (file)
@@ -2019,6 +2019,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
        CURLcode error = CURLE_OK;
        zend_long lval;
 
+       ZVAL_DEREF(zvalue);
        switch (option) {
                /* Long options */
                case CURLOPT_SSL_VERIFYHOST:
@@ -2464,6 +2465,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
                        }
 
                        ZEND_HASH_FOREACH_VAL(ph, current) {
+                               ZVAL_DEREF(current);
                                val = zval_get_string(current);
                                slist = curl_slist_append(slist, ZSTR_VAL(val));
                                zend_string_release(val);
@@ -2531,6 +2533,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
                                                zend_string_addref(string_key);
                                        }
 
+                                       ZVAL_DEREF(current);
                                        if (Z_TYPE_P(current) == IS_OBJECT &&
                                                        instanceof_function(Z_OBJCE_P(current), curl_CURLFile_class)) {
                                                /* new-style file upload */