]> granicus.if.org Git - php/commitdiff
Fixed bug #51171 (curl_setopt() doesn't output any errors or warnings when an invalid...
authorIlia Alshanetsky <iliaa@php.net>
Tue, 2 Mar 2010 12:54:23 +0000 (12:54 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 2 Mar 2010 12:54:23 +0000 (12:54 +0000)
NEWS
ext/curl/interface.c

diff --git a/NEWS b/NEWS
index 5cf0774d04f7e0753c307caa92cbb8fc660c5214..5251af230a0d13ea6346289a589f8060284ae347 100644 (file)
--- 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
index 298563102e59d15cfc0572cb11f65c0f9774f875..34402d979c2a0ad0877e14c0df1b72cc6251b7f9 100644 (file)
@@ -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;