Fix potential NULL dereference on bad usage
diff --git a/library/ssl_srv.c b/library/ssl_srv.c
index f6d014b..fc21754 100644
--- a/library/ssl_srv.c
+++ b/library/ssl_srv.c
@@ -2595,7 +2595,7 @@
         curve = ssl->handshake->curves;
 #endif
 
-        if( *curve == NULL )
+        if( curve == NULL || *curve == NULL )
         {
             SSL_DEBUG_MSG( 1, ( "no matching curve for ECDHE" ) );
             return( POLARSSL_ERR_SSL_NO_CIPHER_CHOSEN );