Add variable validation
1. Check allocation success.
2. Check parameter correctness in the use_srtp extension
in server and client.
Signed-off-by: Johan Pascal <johan.pascal@belledonne-communications.com>
diff --git a/library/ssl_tls.c b/library/ssl_tls.c
index b15df14..1b4779b 100644
--- a/library/ssl_tls.c
+++ b/library/ssl_tls.c
@@ -4807,6 +4807,8 @@
conf->dtls_srtp_profile_list =
(mbedtls_ssl_srtp_profile*)mbedtls_calloc(1,
profiles_number * sizeof( mbedtls_ssl_srtp_profile ) );
+ if( conf->dtls_srtp_profile_list == NULL )
+ return( MBEDTLS_ERR_SSL_ALLOC_FAILED );
for( i=0; i < profiles_number; i++ ) {
switch( profiles[i] ) {