1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-11-23 01:49:53 +03:00

null pointer derefence found by clang static analyzer

This commit is contained in:
Ilya Shipitsin 2016-11-28 19:12:03 +05:00
parent a658963cdc
commit 8d59c33b92

View File

@ -6651,8 +6651,11 @@ SOCK *SocksConnectEx2(CONNECTION *c, char *proxy_host_name, UINT proxy_port,
// Validate arguments // Validate arguments
if (c == NULL || proxy_host_name == NULL || proxy_port == 0 || server_host_name == NULL if (c == NULL || proxy_host_name == NULL || proxy_port == 0 || server_host_name == NULL
|| server_port == 0) || server_port == 0)
{
if (c != NULL)
{ {
c->Err = ERR_PROXY_CONNECT_FAILED; c->Err = ERR_PROXY_CONNECT_FAILED;
}
return NULL; return NULL;
} }
@ -6845,8 +6848,11 @@ SOCK *ProxyConnectEx2(CONNECTION *c, char *proxy_host_name, UINT proxy_port,
// Validate arguments // Validate arguments
if (c == NULL || proxy_host_name == NULL || proxy_port == 0 || server_host_name == NULL || if (c == NULL || proxy_host_name == NULL || proxy_port == 0 || server_host_name == NULL ||
server_port == 0) server_port == 0)
{
if( c != NULL)
{ {
c->Err = ERR_PROXY_CONNECT_FAILED; c->Err = ERR_PROXY_CONNECT_FAILED;
}
return NULL; return NULL;
} }
if (username != NULL && password != NULL && if (username != NULL && password != NULL &&