Merge PR #1018: Proto_OpenVPN.c: fix segmentation fault in OvsProceccRecvPacket()

This commit is contained in:
Davide Beatrici authored and GitHub committed 2019-10-26 00:53:27 +02:00
commit 7349c4b16a
1 file changed
+6 -4
+6 -4
View File
@@ -681,10 +681,12 @@ void OvsProceccRecvPacket(OPENVPN_SERVER *s, UDPPACKET *p)
{
// Decrypt
size = OvsDecrypt(c->CipherDecrypt, c->MdRecv, c->IvRecv, data, recv_packet->Data, recv_packet->DataSize);
// Seek buffer after the packet ID
data += sizeof(UINT);
size -= sizeof(UINT);
if (size > sizeof(UINT))
{
// Seek buffer after the packet ID
data += sizeof(UINT);
size -= sizeof(UINT);
}
}
// Update of last communication time