From 2c2caa81bca0ec13a53c0ccb65b8cf56a571f43b Mon Sep 17 00:00:00 2001 From: Ilya Shipitsin Date: Fri, 31 Aug 2018 00:50:53 +0500 Subject: [PATCH 1/3] src/Cedar/Interop_OpenVPN: resolve coverity "issue" coverity thinks there might be null pointer dereference. we can safely remove a check here, because OvsFreePacket checks for null itself --- src/Cedar/Interop_OpenVPN.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Cedar/Interop_OpenVPN.c b/src/Cedar/Interop_OpenVPN.c index 854e1ba0..9343d9d1 100644 --- a/src/Cedar/Interop_OpenVPN.c +++ b/src/Cedar/Interop_OpenVPN.c @@ -1661,10 +1661,7 @@ OPENVPN_PACKET *OvsParsePacket(UCHAR *data, UINT size) LABEL_ERROR: Debug("OvsParsePacket Error.\n"); - if (ret != NULL) - { - OvsFreePacket(ret); - } + OvsFreePacket(ret); return NULL; } From 9675b0eb6d684d307e58a71000f0dd7227dc6b2a Mon Sep 17 00:00:00 2001 From: Ilya Shipitsin Date: Fri, 31 Aug 2018 00:56:00 +0500 Subject: [PATCH 2/3] src/Cedar/IPsec_EtherIP: resolve "Identical code for different branches" found by coverity --- src/Cedar/IPsec_EtherIP.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/Cedar/IPsec_EtherIP.c b/src/Cedar/IPsec_EtherIP.c index 41d11630..e91bd15d 100644 --- a/src/Cedar/IPsec_EtherIP.c +++ b/src/Cedar/IPsec_EtherIP.c @@ -541,16 +541,8 @@ UINT CalcEtherIPTcpMss(ETHERIP_SERVER *s) } } - if (s->L2TPv3 == false) - { - // EtherIP - ret -= 2; - } - else - { - // L2TPv3 - ret -= 2; - } + // EtherIP, L2TPv3 + ret -= 2; // Ethernet ret -= 14; From 156166dba198f8e237199d0e031599a560cc5dda Mon Sep 17 00:00:00 2001 From: Ilya Shipitsin Date: Fri, 31 Aug 2018 00:59:06 +0500 Subject: [PATCH 3/3] src/Cedar/Hub: resolve null pointer dereference found by coverity --- src/Cedar/Hub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cedar/Hub.c b/src/Cedar/Hub.c index 4af7debb..1fb6b458 100644 --- a/src/Cedar/Hub.c +++ b/src/Cedar/Hub.c @@ -3700,7 +3700,7 @@ bool HubPaPutPacket(SESSION *s, void *data, UINT size) pa->Now = Tick64(); // Processing of Adjust TCP MSS - if (hub->Option != NULL && hub->Option->DisableAdjustTcpMss == false && s != NULL) + if (hub != NULL && hub->Option != NULL && hub->Option->DisableAdjustTcpMss == false && s != NULL) { UINT target_mss = (hub->Option->AdjustTcpMssValue == 0 ? INFINITE : hub->Option->AdjustTcpMssValue); UINT session_mss = (s->AdjustMss == 0 ? INFINITE : s->AdjustMss);