Skip to content

Commit

Permalink
Fix Issue #8687
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan Winzig <[email protected]>
  • Loading branch information
jwinzig-at-hilscher authored and daverodgman committed Jan 22, 2024
1 parent d78496c commit e90cbc3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions library/x509_create.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,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;
Expand Down

0 comments on commit e90cbc3

Please sign in to comment.