mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-12-16 04:09:39 +00:00
mbedtls: CVE-2025-47917 fix
Backported from 3.6.x Prevents crash and/or possible memory leak from invalid input
This commit is contained in:
parent
44d047d496
commit
a200df3566
8
Externals/mbedtls/library/x509_create.c
vendored
8
Externals/mbedtls/library/x509_create.c
vendored
@ -122,8 +122,12 @@ int mbedtls_x509_string_to_names(mbedtls_asn1_named_data **head, const char *nam
|
||||
char data[MBEDTLS_X509_MAX_DN_NAME_SIZE];
|
||||
char *d = data;
|
||||
|
||||
/* Clear existing chain if present */
|
||||
mbedtls_asn1_free_named_data_list(head);
|
||||
/* Ensure the output parameter is not already populated.
|
||||
* (If it were, overwriting it would likely cause a memory leak.)
|
||||
*/
|
||||
if (*head != NULL) {
|
||||
return MBEDTLS_ERR_X509_BAD_INPUT_DATA;
|
||||
}
|
||||
|
||||
while (c <= end) {
|
||||
if (in_tag && *c == '=') {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user