diff --git a/Logan/mbedtls/library/x509_create.c b/Logan/mbedtls/library/x509_create.c index df20ec8e..3da2d1c6 100644 --- a/Logan/mbedtls/library/x509_create.c +++ b/Logan/mbedtls/library/x509_create.c @@ -168,6 +168,10 @@ int mbedtls_x509_set_extension( mbedtls_asn1_named_data **head, const char *oid, { mbedtls_asn1_named_data *cur; + if (val_len > (SIZE_MAX - 1)) { + return MBEDTLS_ERR_X509_BAD_INPUT_DATA; + } + if( ( cur = mbedtls_asn1_store_named_data( head, oid, oid_len, NULL, val_len + 1 ) ) == NULL ) {