From ade9e28d9f630da6eb81ebef8d0129d75baeb534 Mon Sep 17 00:00:00 2001 From: Andrzej Kurek Date: Tue, 7 May 2019 08:19:33 -0400 Subject: [PATCH] ssl_cli.c : add explicit casting to unsigned char Signal casting from size_t to unsigned char explicitly, so that the compiler does not raise a warning about possible loss of data on MSVC, targeting 64-bit Windows. --- library/ssl_cli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/ssl_cli.c b/library/ssl_cli.c index 78059054a..aabf4d485 100644 --- a/library/ssl_cli.c +++ b/library/ssl_cli.c @@ -3171,7 +3171,7 @@ static int ssl_write_client_key_exchange( mbedtls_ssl_context *ssl ) } /* Copy ECPoint structure to outgoing message buffer. */ - ssl->out_msg[header_len] = own_pubkey_ecpoint_len; + ssl->out_msg[header_len] = (unsigned char) own_pubkey_ecpoint_len; memcpy( ssl->out_msg + header_len + 1, own_pubkey_ecpoint, own_pubkey_ecpoint_len ); content_len = own_pubkey_ecpoint_len + 1;