summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2019-06-24 08:32:01 +0100
committerGitHub <noreply@github.com>2019-06-24 08:32:01 +0100
commit131a4b14fa03a65f093524fcd943628038323238 (patch)
treee1aaa6f0510b84dcb3a5f9728d7245dfccd4ad2a
parent297e7efa0af0765b3030dce726e54dde0b37f95c (diff)
parent6baa3ff0de8a771f6d51a74dce21d79aa07b0356 (diff)
Merge pull request #30019 from Faless/tls/stream_check
Add NULL check in SSL connect_to_stream
-rwxr-xr-xmodules/mbedtls/stream_peer_mbed_tls.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/mbedtls/stream_peer_mbed_tls.cpp b/modules/mbedtls/stream_peer_mbed_tls.cpp
index 45d3b86919..3541eff25a 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<StreamPeer> 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;