From e878927cd71161afb2ffe92e85bd74a8280b183b Mon Sep 17 00:00:00 2001 From: akallabeth Date: Thu, 3 Oct 2024 13:15:24 +0200 Subject: [PATCH] [warnings] fix integer narrowing --- libfreerdp/core/gateway/arm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libfreerdp/core/gateway/arm.c b/libfreerdp/core/gateway/arm.c index 886e3914e..49d0c183a 100644 --- a/libfreerdp/core/gateway/arm.c +++ b/libfreerdp/core/gateway/arm.c @@ -140,7 +140,7 @@ static BOOL arm_tls_connect(rdpArm* arm, rdpTls* tls, int timeout) } tls->hostname = freerdp_settings_get_string(settings, FreeRDP_GatewayHostname); - tls->port = settings->GatewayPort; + tls->port = MIN(UINT16_MAX, settings->GatewayPort); tls->isGatewayTransport = TRUE; status = freerdp_tls_connect(tls, bufferedBio); if (status < 1) @@ -241,7 +241,7 @@ static BOOL arm_send_http_request(rdpArm* arm, rdpTls* tls, const char* method, const size_t sz = Stream_Length(s); if (sz <= INT_MAX) - status = freerdp_tls_write_all(tls, Stream_Buffer(s), (int)sz); + status = freerdp_tls_write_all(tls, Stream_Buffer(s), sz); Stream_Free(s, TRUE); if (status >= 0 && content_length > 0 && data)