openssl/mbedtls: use %d for outputing port with failf (int)

Coverity CID 1517100

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

Closes #10001
This commit is contained in:
Daniel Stenberg 2022-11-29 16:45:39 +01:00
parent f85e932b28
commit 07203b0bb8
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
3 changed files with 5 additions and 5 deletions

View 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,

View 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;

View 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);