From 5ea13b854aa7f400a56c1515a56b7629dbf2eae4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Tue, 23 Jul 2019 15:02:54 +0200 Subject: [PATCH] Fix compiler warning: comparing signed to unsigned Since the type of cid_len is unsigned but shorter than int, it gets "promoted" to int (which is also the type of the result), unless we make the other operand an unsigned int which then forces the expression to unsigned int as well. --- library/ssl_tls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/ssl_tls.c b/library/ssl_tls.c index 60e9ab0e2..8212baa30 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c @@ -11674,7 +11674,7 @@ static int ssl_context_load( mbedtls_ssl_context *ssl, ssl->transform->in_cid_len = *p++; - if( (size_t)( end - p ) < ssl->transform->in_cid_len + 1 ) + if( (size_t)( end - p ) < ssl->transform->in_cid_len + 1u ) return( MBEDTLS_ERR_SSL_BAD_INPUT_DATA ); memcpy( ssl->transform->in_cid, p, ssl->transform->in_cid_len );