1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-08-08 17:42:09 +03:00

- Check for failed malloc() in ssl_set_hostname() and x509_get_entries() (Closes ticket #47, found by Hugo Leisink)

This commit is contained in:
Paul Bakker
2012-01-13 13:44:06 +00:00
parent 8b21f7a55d
commit b15b851d6d
4 changed files with 13 additions and 1 deletions

View File

@@ -968,6 +968,10 @@ static int x509_get_entries( unsigned char **p,
if ( *p < end )
{
cur_entry->next = malloc( sizeof( x509_crl_entry ) );
if( cur_entry->next == NULL )
return( POLARSSL_ERR_X509_MALLOC_FAILED );
cur_entry = cur_entry->next;
memset( cur_entry, 0, sizeof( x509_crl_entry ) );
}