From 7910cdd47fab98e29af6a1c6c7a4730f4ece8a58 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Mon, 2 Oct 2023 15:39:13 +0200 Subject: [PATCH] Avoid compiler warning about size comparison GCC warns about comparing uint8_t to a size that may be >255. Strangely, casting the uint8_t to a size_t in the comparison expression doesn't avoid the warning. So change the type of the variable. Signed-off-by: Gilles Peskine --- library/ssl_tls12_client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/ssl_tls12_client.c b/library/ssl_tls12_client.c index 02f6cd369..27bbafa06 100644 --- a/library/ssl_tls12_client.c +++ b/library/ssl_tls12_client.c @@ -1727,7 +1727,7 @@ static int ssl_parse_server_ecdh_params(mbedtls_ssl_context *ssl, unsigned char *end) { uint16_t tls_id; - uint8_t ecpoint_len; + size_t ecpoint_len; mbedtls_ssl_handshake_params *handshake = ssl->handshake; psa_key_type_t key_type = PSA_KEY_TYPE_NONE; size_t ec_bits = 0;