Merge pull request #8241 from daverodgman/cast_warning

fix cast warning
This commit is contained in:
Dave Rodgman 2023-09-22 14:23:05 +00:00 committed by GitHub
commit 4f53520f54
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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));