From 38c3228f3e3406e388a30394c0498a8dba4d6aef Mon Sep 17 00:00:00 2001 From: Dave Rodgman Date: Fri, 22 Sep 2023 10:51:37 +0100 Subject: [PATCH] fix cast warning Signed-off-by: Dave Rodgman --- library/pkparse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/pkparse.c b/library/pkparse.c index fe01a1149b..83291c4c7c 100644 --- a/library/pkparse.c +++ b/library/pkparse.c @@ -737,7 +737,7 @@ static int pk_get_ecpubkey(unsigned char **p, const unsigned char *end, #endif /* MBEDTLS_PK_PARSE_EC_COMPRESSED */ } else { /* Uncompressed format */ - if ((end - *p) > MBEDTLS_PK_MAX_EC_PUBKEY_RAW_LEN) { + if ((size_t) (end - *p) > MBEDTLS_PK_MAX_EC_PUBKEY_RAW_LEN) { return MBEDTLS_ERR_PK_BUFFER_TOO_SMALL; } memcpy(pk->pub_raw, *p, (end - *p));