mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-29 11:41:15 +03:00
Merge pull request #8688 from jwinzig-at-hilscher/development
Fix bug in mbedtls_x509_set_extension
This commit is contained in:
@ -382,6 +382,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) {
|
||||
return MBEDTLS_ERR_X509_ALLOC_FAILED;
|
||||
|
Reference in New Issue
Block a user