1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2025-09-24 12:19:20 +03:00

Fix potential NULL pointer dereference

This commit is contained in:
icy17
2024-08-01 15:43:34 +08:00
parent a836b3bd5e
commit e2017772c7
2 changed files with 22 additions and 0 deletions

View File

@ -11860,6 +11860,12 @@ bool StartSSLEx3(SOCK *sock, X *x, K *priv, LIST *chain, UINT ssl_timeout, char
#endif
sock->ssl = SSL_new(ssl_ctx);
if (sock->ssl == NULL)
{
return false;
}
SSL_set_fd(sock->ssl, (int)sock->socket);
#ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
@ -16250,6 +16256,12 @@ UINT GetOSSecurityLevel()
UINT security_level_new = 0, security_level_set_ssl_version = 0;
struct ssl_ctx_st *ctx = SSL_CTX_new(SSLv23_method());
if (ctx == NULL)
{
return security_level_new;
}
#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
security_level_new = SSL_CTX_get_security_level(ctx);
#endif