mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-08 17:42:09 +03:00
Use size_t cast for pointer subtractions
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
This commit is contained in:
@@ -51,7 +51,7 @@ static int dhm_read_bignum(mbedtls_mpi *X,
|
||||
n = ((*p)[0] << 8) | (*p)[1];
|
||||
(*p) += 2;
|
||||
|
||||
if ((int) (end - *p) < n) {
|
||||
if ((size_t) (end - *p) < (size_t) n) {
|
||||
return MBEDTLS_ERR_DHM_BAD_INPUT_DATA;
|
||||
}
|
||||
|
||||
@@ -257,7 +257,7 @@ int mbedtls_dhm_make_params(mbedtls_dhm_context *ctx, int x_size,
|
||||
DHM_MPI_EXPORT(&ctx->G, n2);
|
||||
DHM_MPI_EXPORT(&ctx->GX, n3);
|
||||
|
||||
*olen = p - output;
|
||||
*olen = (size_t) (p - output);
|
||||
|
||||
cleanup:
|
||||
if (ret != 0 && ret > -128) {
|
||||
|
Reference in New Issue
Block a user