mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-30 22:43:08 +03:00
Use size_t cast for pointer subtractions
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
This commit is contained in:
@ -185,7 +185,7 @@ static int x509write_csr_der_internal(mbedtls_x509write_csr *ctx,
|
||||
MBEDTLS_ASN1_CONSTRUCTED | MBEDTLS_ASN1_CONTEXT_SPECIFIC));
|
||||
|
||||
MBEDTLS_ASN1_CHK_ADD(pub_len, mbedtls_pk_write_pubkey_der(ctx->key,
|
||||
buf, c - buf));
|
||||
buf, (size_t) (c - buf)));
|
||||
c -= pub_len;
|
||||
len += pub_len;
|
||||
|
||||
@ -276,7 +276,7 @@ static int x509write_csr_der_internal(mbedtls_x509write_csr *ctx,
|
||||
MBEDTLS_ASN1_CONSTRUCTED | MBEDTLS_ASN1_SEQUENCE));
|
||||
|
||||
/* Zero the unused bytes at the start of buf */
|
||||
memset(buf, 0, c2 - buf);
|
||||
memset(buf, 0, (size_t) (c2 - buf));
|
||||
|
||||
return (int) len;
|
||||
}
|
||||
|
Reference in New Issue
Block a user