com php-src: Fixed bug #71709: ext/curl/interface.c
| From: | Pierrick Charron | Date: | Tue, 26 Jul 2016 22:50:15 +0000 |
| Subject: | com php-src: Fixed bug #71709: ext/curl/interface.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-93404@lists.php.net to get a copy of this message | ||
Commit: 24d8f6ed7c583c82d6ed63080d235474f8afec6a
Author: Pierrick Charron <pierrick@php.net> Tue, 26 Jul 2016 18:50:15 -0400
Parents: 64e3e932fc38dc7e59805dfb28acae173503018b
Branches: PHP-5.6 PHP-7.0 PHP-7.1 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=24d8f6ed7c583c82d6ed63080d235474f8afec6a
Log:
Fixed bug #71709
When curl_setopt is called with an empty slist as value, we should
not add the empty slist to the list of slist to free.
Bugs:
https://bugs.php.net/71709
Changed paths:
M ext/curl/interface.c
Diff:
diff --git a/ext/curl/interface.c b/ext/curl/interface.c
index 7e58c7f..dc4a971 100644
--- a/ext/curl/interface.c
+++ b/ext/curl/interface.c
@@ -2556,12 +2556,13 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue
TSRMLS_DC)
}
}
- if (Z_REFCOUNT_P(ch->clone) <= 1) {
- zend_hash_index_update(ch->to_free->slist, (ulong) option, &slist, sizeof(struct
curl_slist *), NULL);
- } else {
- zend_hash_next_index_insert(ch->to_free->slist, &slist, sizeof(struct curl_slist *),
NULL);
+ if (slist) {
+ if (Z_REFCOUNT_P(ch->clone) <= 1) {
+ zend_hash_index_update(ch->to_free->slist, (ulong) option, &slist, sizeof(struct
curl_slist *), NULL);
+ } else {
+ zend_hash_next_index_insert(ch->to_free->slist, &slist, sizeof(struct curl_slist *),
NULL);
+ }
}
-
error = curl_easy_setopt(ch->cp, option, slist);
break;