mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-07 06:05:34 +00:00
Fix unchecked malloc()
Found using Infer.
This commit is contained in:
parent
26d88cf154
commit
78a428dbd0
|
@ -3066,6 +3066,11 @@ int ssl_init( ssl_context *ssl )
|
|||
ssl->min_minor_ver = SSL_MINOR_VERSION_0;
|
||||
|
||||
ssl->ciphersuites = malloc( sizeof(int *) * 4 );
|
||||
if( ssl->ciphersuites == NULL )
|
||||
{
|
||||
SSL_DEBUG_MSG( 1, ( "malloc(%d bytes) failed", sizeof(int *) * 4) );
|
||||
return( POLARSSL_ERR_SSL_MALLOC_FAILED );
|
||||
}
|
||||
ssl_set_ciphersuites( ssl, ssl_default_ciphersuites );
|
||||
|
||||
#if defined(POLARSSL_DHM_C)
|
||||
|
|
Loading…
Reference in a new issue