diff --git a/library/ssl_msg.c b/library/ssl_msg.c index 51eb4619c6..6838a3b494 100644 --- a/library/ssl_msg.c +++ b/library/ssl_msg.c @@ -4798,6 +4798,9 @@ size_t mbedtls_ssl_get_bytes_avail( const mbedtls_ssl_context *ssl ) int mbedtls_ssl_check_pending( const mbedtls_ssl_context *ssl ) { + if( ssl == NULL || ssl->conf == NULL ) + return( MBEDTLS_ERR_SSL_BAD_INPUT_DATA ); + /* * Case A: We're currently holding back * a message for further processing.