From 6baa3ff0de8a771f6d51a74dce21d79aa07b0356 Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Mon, 24 Jun 2019 07:43:31 +0200 Subject: [PATCH] Add NULL check in SSL connect_to_stream --- modules/mbedtls/stream_peer_mbed_tls.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/mbedtls/stream_peer_mbed_tls.cpp b/modules/mbedtls/stream_peer_mbed_tls.cpp index 45d3b869191..3541eff25aa 100755 --- a/modules/mbedtls/stream_peer_mbed_tls.cpp +++ b/modules/mbedtls/stream_peer_mbed_tls.cpp @@ -122,6 +122,8 @@ Error StreamPeerMbedTLS::_do_handshake() { Error StreamPeerMbedTLS::connect_to_stream(Ref p_base, bool p_validate_certs, const String &p_for_hostname) { + ERR_FAIL_COND_V(p_base.is_null(), ERR_INVALID_PARAMETER); + base = p_base; int ret = 0; int authmode = p_validate_certs ? MBEDTLS_SSL_VERIFY_REQUIRED : MBEDTLS_SSL_VERIFY_NONE;