mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-29 11:41:15 +03:00
Use size_t cast for pointer subtractions
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
This commit is contained in:
@ -363,7 +363,7 @@ static int ecdh_read_params_internal(mbedtls_ecdh_context_mbed *ctx,
|
||||
const unsigned char *end)
|
||||
{
|
||||
return mbedtls_ecp_tls_read_point(&ctx->grp, &ctx->Qp, buf,
|
||||
end - *buf);
|
||||
(size_t) (end - *buf));
|
||||
}
|
||||
|
||||
/*
|
||||
@ -379,7 +379,7 @@ int mbedtls_ecdh_read_params(mbedtls_ecdh_context *ctx,
|
||||
{
|
||||
int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
|
||||
mbedtls_ecp_group_id grp_id;
|
||||
if ((ret = mbedtls_ecp_tls_read_group_id(&grp_id, buf, end - *buf))
|
||||
if ((ret = mbedtls_ecp_tls_read_group_id(&grp_id, buf, (size_t) (end - *buf)))
|
||||
!= 0) {
|
||||
return ret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user