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 GitHub
parent 05c722bfd0
commit 5caf20ea80
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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