mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2024-11-25 19:09:52 +03:00
src/Cedar/BridgeUnix.c: resolve null pointer dereference
found by coverity
This commit is contained in:
parent
6014ec8eb5
commit
60bb1c34de
@ -2676,6 +2676,7 @@ bool EthProcessIpPacketInnerIpRaw(ETH *e, PKT *p)
|
|||||||
void EthPutPacketLinuxIpRaw(ETH *e, void *data, UINT size)
|
void EthPutPacketLinuxIpRaw(ETH *e, void *data, UINT size)
|
||||||
{
|
{
|
||||||
PKT *p;
|
PKT *p;
|
||||||
|
SOCK *s = NULL;
|
||||||
// Validate arguments
|
// Validate arguments
|
||||||
if (e == NULL || data == NULL)
|
if (e == NULL || data == NULL)
|
||||||
{
|
{
|
||||||
@ -2688,8 +2689,13 @@ void EthPutPacketLinuxIpRaw(ETH *e, void *data, UINT size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
p = ParsePacket(data, size);
|
p = ParsePacket(data, size);
|
||||||
|
if (p == NULL)
|
||||||
|
{
|
||||||
|
Free(data);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (p != NULL && (p->BroadcastPacket || Cmp(p->MacAddressDest, e->RawIpMyMacAddr, 6) == 0))
|
if (p->BroadcastPacket || Cmp(p->MacAddressDest, e->RawIpMyMacAddr, 6) == 0)
|
||||||
{
|
{
|
||||||
if (IsValidUnicastMacAddress(p->MacAddressSrc))
|
if (IsValidUnicastMacAddress(p->MacAddressSrc))
|
||||||
{
|
{
|
||||||
@ -2705,9 +2711,6 @@ void EthPutPacketLinuxIpRaw(ETH *e, void *data, UINT size)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p != NULL)
|
|
||||||
{
|
|
||||||
SOCK *s = NULL;
|
|
||||||
|
|
||||||
if (p->TypeL3 == L3_IPV4)
|
if (p->TypeL3 == L3_IPV4)
|
||||||
{
|
{
|
||||||
@ -2790,8 +2793,6 @@ void EthPutPacketLinuxIpRaw(ETH *e, void *data, UINT size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
FreePacket(p);
|
FreePacket(p);
|
||||||
}
|
|
||||||
|
|
||||||
Free(data);
|
Free(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user