1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-11-22 17:39:53 +03:00

src/Cedar/IPsec_IKE.c: resolve null pointer dereference found by coverity,

remove unused variable

[src/Cedar/IPsec_IKE.c:4332] -> [src/Cedar/IPsec_IKE.c:4332]: (style) Same expression on both sides of '||'.
[src/Cedar/IPsec_IKE.c:1665]: (style) Variable 'zero' is assigned a value that is never used.
This commit is contained in:
Ilya Shipitsin 2018-08-24 15:25:34 +05:00
parent 2f7d71a567
commit a58d26f125

View File

@ -1662,7 +1662,6 @@ void StartQuickMode(IKE_SERVER *ike, IKE_CLIENT *c)
UINT spi; UINT spi;
UINT spi_be; UINT spi_be;
UCHAR hash1[IKE_MAX_HASH_SIZE]; UCHAR hash1[IKE_MAX_HASH_SIZE];
UCHAR zero = 0;
DH_CTX *dh = NULL; DH_CTX *dh = NULL;
UCHAR dummy_hash_data[IKE_MAX_HASH_SIZE]; UCHAR dummy_hash_data[IKE_MAX_HASH_SIZE];
@ -3842,6 +3841,10 @@ bool IkeIsVendorIdExists(IKE_PACKET *p, char *str)
for (i = 0;i < num;i++) for (i = 0;i < num;i++)
{ {
IKE_PACKET_PAYLOAD *payload = IkeGetPayload(p->PayloadList, IKE_PAYLOAD_VENDOR_ID, i); IKE_PACKET_PAYLOAD *payload = IkeGetPayload(p->PayloadList, IKE_PAYLOAD_VENDOR_ID, i);
if (payload == NULL)
{
return false;
}
if (CompareBuf(payload->Payload.VendorId.Data, buf)) if (CompareBuf(payload->Payload.VendorId.Data, buf))
{ {
@ -4325,7 +4328,7 @@ IKE_CLIENT *SearchOrCreateNewIkeClientForIkePacket(IKE_SERVER *ike, IP *client_i
{ {
IKE_CLIENT *c; IKE_CLIENT *c;
// Validate arguments // Validate arguments
if (ike == NULL || pr == NULL || client_ip == NULL || server_ip == NULL || client_port == 0 || server_port == 0 || pr == NULL) if (ike == NULL || pr == NULL || client_ip == NULL || server_ip == NULL || client_port == 0 || server_port == 0)
{ {
return NULL; return NULL;
} }