mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-07 06:42:56 +03:00
Use size_t cast for pointer subtractions
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
This commit is contained in:
@@ -928,7 +928,7 @@ int mbedtls_pk_parse_subpubkey(unsigned char **p, const unsigned char *end,
|
||||
ret = pk_use_ecparams(&alg_params, pk);
|
||||
}
|
||||
if (ret == 0) {
|
||||
ret = pk_ecc_set_pubkey(pk, *p, end - *p);
|
||||
ret = pk_ecc_set_pubkey(pk, *p, (size_t) (end - *p));
|
||||
*p += end - *p;
|
||||
}
|
||||
} else
|
||||
@@ -1233,7 +1233,7 @@ static int pk_parse_key_sec1_der(mbedtls_pk_context *pk,
|
||||
MBEDTLS_ERR_ASN1_LENGTH_MISMATCH);
|
||||
}
|
||||
|
||||
if ((ret = pk_ecc_set_pubkey(pk, p, end2 - p)) == 0) {
|
||||
if ((ret = pk_ecc_set_pubkey(pk, p, (size_t) (end2 - p))) == 0) {
|
||||
pubkey_done = 1;
|
||||
} else {
|
||||
/*
|
||||
|
Reference in New Issue
Block a user