]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
openssl/mbedtls: use %d for outputing port with failf (int)
authorDaniel Stenberg <daniel@haxx.se>
Tue, 29 Nov 2022 15:45:39 +0000 (16:45 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 29 Nov 2022 22:16:47 +0000 (23:16 +0100)
Coverity CID 1517100

Also, remove some int typecasts in vtls.c for the port number

Closes #10001

lib/vtls/mbedtls.c
lib/vtls/openssl.c
lib/vtls/vtls.c

index e131ac06c2c53c0aad9ca1a0f1154fd519ce6618..0b81662b939cb0245da29306dc56b67c926d1355 100644 (file)
@@ -541,7 +541,7 @@ mbed_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data)
   }
 #endif
 
-  infof(data, "mbedTLS: Connecting to %s:%ld", hostname, connssl->port);
+  infof(data, "mbedTLS: Connecting to %s:%d", hostname, connssl->port);
 
   mbedtls_ssl_config_init(&backend->config);
   ret = mbedtls_ssl_config_defaults(&backend->config,
index 8d93d41e27ebf3645190bb9fa7c603e76fe83472..0f04fcdb054037f71c7ff4bcec209e3f36331383 100644 (file)
@@ -3989,7 +3989,7 @@ static CURLcode ossl_connect_step2(struct Curl_cfilter *cf,
 
         if(sockerr && detail == SSL_ERROR_SYSCALL)
           Curl_strerror(sockerr, extramsg, sizeof(extramsg));
-        failf(data, OSSL_PACKAGE " SSL_connect: %s in connection to %s:%ld ",
+        failf(data, OSSL_PACKAGE " SSL_connect: %s in connection to %s:%d ",
               extramsg[0] ? extramsg : SSL_ERROR_to_str(detail),
               connssl->hostname, connssl->port);
         return result;
index 303efc39d213574cbc52bc1f29f594162c41ec39..e84c99346fd53c89ca88fe65d8b5e4db7647ffc8 100644 (file)
@@ -1451,7 +1451,7 @@ static void reinit_hostname(struct Curl_cfilter *cf)
     /* TODO: there is not definition for a proxy setup on a secondary conn */
     connssl->hostname = cf->conn->http_proxy.host.name;
     connssl->dispname = cf->conn->http_proxy.host.dispname;
-    connssl->port = (int)cf->conn->http_proxy.port;
+    connssl->port = cf->conn->http_proxy.port;
   }
   else
 #endif
@@ -1462,12 +1462,12 @@ static void reinit_hostname(struct Curl_cfilter *cf)
     if(cf->sockindex == SECONDARYSOCKET && 0) {
       connssl->hostname = cf->conn->secondaryhostname;
       connssl->dispname = connssl->hostname;
-      connssl->port = (int)cf->conn->secondary_port;
+      connssl->port = cf->conn->secondary_port;
     }
     else {
       connssl->hostname = cf->conn->host.name;
       connssl->dispname = cf->conn->host.dispname;
-      connssl->port = (int)cf->conn->remote_port;
+      connssl->port = cf->conn->remote_port;
     }
   }
   DEBUGASSERT(connssl->hostname);