@@ -843,7 +843,7 @@ static size_t curl_read(char *data, size_t size, size_t nmemb, void *ctx)
843843{
844844 php_curl * ch = (php_curl * )ctx ;
845845 php_curl_read * read_handler = ch -> handlers .read ;
846- int length = 0 ;
846+ size_t length = 0 ;
847847
848848 switch (read_handler -> method ) {
849849 case PHP_CURL_DIRECT :
@@ -1184,15 +1184,14 @@ static void create_certinfo(struct curl_certinfo *ci, zval *listcode)
11841184
11851185 array_init (& certhash );
11861186 for (slist = ci -> certinfo [i ]; slist ; slist = slist -> next ) {
1187- int len ;
11881187 char s [64 ];
11891188 char * tmp ;
11901189 strncpy (s , slist -> data , sizeof (s ));
11911190 s [sizeof (s )- 1 ] = '\0' ;
11921191 tmp = memchr (s , ':' , sizeof (s ));
11931192 if (tmp ) {
11941193 * tmp = '\0' ;
1195- len = strlen (s );
1194+ size_t len = strlen (s );
11961195 add_assoc_string (& certhash , s , & slist -> data [len + 1 ]);
11971196 } else {
11981197 php_error_docref (NULL , E_WARNING , "Could not extract hash key from certificate info" );
@@ -1445,7 +1444,6 @@ static inline zend_result build_mime_structure_from_hash(php_curl *ch, zval *zpo
14451444 zval * prop , rv ;
14461445 char * type = NULL , * filename = NULL ;
14471446 struct mime_data_cb_arg * cb_arg ;
1448- php_stream * stream ;
14491447 php_stream_statbuf ssb ;
14501448 size_t filesize = -1 ;
14511449 curl_seek_callback seekfunc = seek_cb ;
@@ -1475,6 +1473,7 @@ static inline zend_result build_mime_structure_from_hash(php_curl *ch, zval *zpo
14751473 zval_ptr_dtor (& ch -> postfields );
14761474 ZVAL_COPY (& ch -> postfields , zpostfields );
14771475
1476+ php_stream * stream ;
14781477 if ((stream = php_stream_open_wrapper (ZSTR_VAL (postval ), "rb" , STREAM_MUST_SEEK , NULL ))) {
14791478 if (!stream -> readfilters .head && !php_stream_stat (stream , & ssb )) {
14801479 filesize = ssb .sb .st_size ;
@@ -2409,7 +2408,7 @@ PHP_FUNCTION(curl_setopt_array)
24092408 ch = Z_CURL_P (zid );
24102409
24112410 ZEND_HASH_FOREACH_KEY_VAL (Z_ARRVAL_P (arr ), option , string_key , entry ) {
2412- if (string_key ) {
2411+ if (UNEXPECTED ( string_key ) ) {
24132412 zend_argument_value_error (2 , "contains an invalid cURL option" );
24142413 RETURN_THROWS ();
24152414 }
0 commit comments