mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2025-07-19 22:20:42 +03:00
Fix use-after-free timeout issue for L2TP and SSTP
This commit is contained in:
@ -275,8 +275,6 @@ void SstpProcessControlPacket(SSTP_SERVER *s, SSTP_PACKET *p)
|
||||
// Process the SSTP received data packet
|
||||
void SstpProcessDataPacket(SSTP_SERVER *s, SSTP_PACKET *p)
|
||||
{
|
||||
PPP_SESSION *underlyingSession;
|
||||
|
||||
// Validate arguments
|
||||
if (s == NULL || p == NULL || p->IsControl)
|
||||
{
|
||||
@ -288,11 +286,9 @@ void SstpProcessDataPacket(SSTP_SERVER *s, SSTP_PACKET *p)
|
||||
if (s->PPPThread == NULL)
|
||||
{
|
||||
// Create a thread to initialize the new PPP module
|
||||
underlyingSession = NewPPPSession(s->Cedar, &s->ClientIp, s->ClientPort, &s->ServerIp, s->ServerPort,
|
||||
s->PPPThread = NewPPPSession(s->Cedar, &s->ClientIp, s->ClientPort, &s->ServerIp, s->ServerPort,
|
||||
s->TubeSend, s->TubeRecv, SSTP_IPC_POSTFIX, SSTP_IPC_CLIENT_NAME,
|
||||
s->ClientHostName, s->ClientCipherName, 0);
|
||||
s->PPPSession = underlyingSession;
|
||||
s->PPPThread = underlyingSession->SessionThread;
|
||||
}
|
||||
|
||||
// Pass the received data to the PPP module
|
||||
@ -444,9 +440,9 @@ void SstpProcessInterrupt(SSTP_SERVER *s)
|
||||
}
|
||||
}
|
||||
|
||||
if (s->PPPSession != NULL && s->PPPSession->DataTimeout > sstpTimeout)
|
||||
if (s->TubeRecv != NULL && s->TubeRecv->DataTimeout > sstpTimeout)
|
||||
{
|
||||
sstpTimeout = s->PPPSession->DataTimeout;
|
||||
sstpTimeout = s->TubeRecv->DataTimeout;
|
||||
}
|
||||
|
||||
if ((s->LastRecvTick + sstpTimeout) <= s->Now)
|
||||
|
Reference in New Issue
Block a user