Fix potential NULL dereference on bad usage

This commit is contained in:
Manuel Pégourié-Gonnard 2015-06-23 18:57:28 +02:00
parent b26b75e17b
commit 8e8ae3d961

View File

@ -2595,7 +2595,7 @@ curve_matching_done:
curve = ssl->handshake->curves; curve = ssl->handshake->curves;
#endif #endif
if( *curve == NULL ) if( curve == NULL || *curve == NULL )
{ {
SSL_DEBUG_MSG( 1, ( "no matching curve for ECDHE" ) ); SSL_DEBUG_MSG( 1, ( "no matching curve for ECDHE" ) );
return( POLARSSL_ERR_SSL_NO_CIPHER_CHOSEN ); return( POLARSSL_ERR_SSL_NO_CIPHER_CHOSEN );