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

Merge PR #683: resolve several issues found by coverity

This commit is contained in:
Davide Beatrici 2018-08-30 22:26:43 +02:00 committed by GitHub
commit 0871c0b5d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 15 deletions

View File

@ -3700,7 +3700,7 @@ bool HubPaPutPacket(SESSION *s, void *data, UINT size)
pa->Now = Tick64(); pa->Now = Tick64();
// Processing of Adjust TCP MSS // 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 target_mss = (hub->Option->AdjustTcpMssValue == 0 ? INFINITE : hub->Option->AdjustTcpMssValue);
UINT session_mss = (s->AdjustMss == 0 ? INFINITE : s->AdjustMss); UINT session_mss = (s->AdjustMss == 0 ? INFINITE : s->AdjustMss);

View File

@ -541,16 +541,8 @@ UINT CalcEtherIPTcpMss(ETHERIP_SERVER *s)
} }
} }
if (s->L2TPv3 == false) // EtherIP, L2TPv3
{
// EtherIP
ret -= 2; ret -= 2;
}
else
{
// L2TPv3
ret -= 2;
}
// Ethernet // Ethernet
ret -= 14; ret -= 14;

View File

@ -1661,10 +1661,7 @@ OPENVPN_PACKET *OvsParsePacket(UCHAR *data, UINT size)
LABEL_ERROR: LABEL_ERROR:
Debug("OvsParsePacket Error.\n"); Debug("OvsParsePacket Error.\n");
if (ret != NULL)
{
OvsFreePacket(ret); OvsFreePacket(ret);
}
return NULL; return NULL;
} }