Update fix to be more platform-independent

Co-authored-by: David Horstmann <david.horstmann@arm.com>
Signed-off-by: Jonathan Winzig <jwinzig@hilscher.com>
This commit is contained in:
Jonathan Winzig 2024-01-09 16:41:10 +01:00 committed by Dave Rodgman
parent 63b5e216f8
commit a0c9448bea

View file

@ -380,7 +380,7 @@ int mbedtls_x509_set_extension(mbedtls_asn1_named_data **head, const char *oid,
{ {
mbedtls_asn1_named_data *cur; mbedtls_asn1_named_data *cur;
if (0xFFFFFFFF == (uint32_t) val_len) { if (val_len > (SIZE_MAX - 1)) {
return MBEDTLS_ERR_X509_BAD_INPUT_DATA; return MBEDTLS_ERR_X509_BAD_INPUT_DATA;
} }