From: Ilia Alshanetsky Date: Tue, 2 Mar 2010 12:54:23 +0000 (+0000) Subject: Fixed bug #51171 (curl_setopt() doesn't output any errors or warnings when an invalid... X-Git-Tag: php-5.2.14RC1~122 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=79c7a6f8b252f7a42d34cead89bdf3402e2ad000;p=php Fixed bug #51171 (curl_setopt() doesn't output any errors or warnings when an invalid option is provided) --- diff --git a/NEWS b/NEWS index 5cf0774d04..5251af230a 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,8 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? 2010, PHP 5.2.14 +- Fixed bug #51171 (curl_setopt() doesn't output any errors or warnings when + an invalid option is provided). (Ilia) 25 Feb 2010, PHP 5.2.13 diff --git a/ext/curl/interface.c b/ext/curl/interface.c index 298563102e..34402d979c 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -1772,6 +1772,10 @@ PHP_FUNCTION(curl_setopt) ZEND_FETCH_RESOURCE(ch, php_curl *, zid, -1, le_curl_name, le_curl); convert_to_long_ex(zoption); + if (Z_LVAL_PP(zoption) <= 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid curl configuration option"); + RETURN_FALSE; + } if (!_php_curl_setopt(ch, Z_LVAL_PP(zoption), zvalue, return_value TSRMLS_CC)) { RETURN_TRUE;