mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2024-11-23 01:49:53 +03:00
Fix thread safety after #1751
This commit is contained in:
parent
11828be9e6
commit
025ebec4cc
@ -3651,9 +3651,18 @@ bool PPPProcessEAPTlsResponse(PPP_SESSION *p, PPP_EAP *eap_packet, UINT eapSize)
|
|||||||
|
|
||||||
if (p->Eap_MatchUserByCert)
|
if (p->Eap_MatchUserByCert)
|
||||||
{
|
{
|
||||||
HUB* hub = GetHub(p->Cedar, p->Eap_Identity.HubName);
|
HUB *hub;
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
|
||||||
|
LockHubList(p->Cedar);
|
||||||
|
{
|
||||||
|
hub = GetHub(p->Cedar, p->Eap_Identity.HubName);
|
||||||
|
}
|
||||||
|
UnlockHubList(p->Cedar);
|
||||||
|
|
||||||
if (hub != NULL)
|
if (hub != NULL)
|
||||||
|
{
|
||||||
|
AcLock(hub);
|
||||||
{
|
{
|
||||||
USER* user = AcGetUserByCert(hub, p->Eap_TlsCtx.ClientCert.X);
|
USER* user = AcGetUserByCert(hub, p->Eap_TlsCtx.ClientCert.X);
|
||||||
if (user != NULL)
|
if (user != NULL)
|
||||||
@ -3662,6 +3671,8 @@ bool PPPProcessEAPTlsResponse(PPP_SESSION *p, PPP_EAP *eap_packet, UINT eapSize)
|
|||||||
found = true;
|
found = true;
|
||||||
ReleaseUser(user);
|
ReleaseUser(user);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
AcUnlock(hub);
|
||||||
ReleaseHub(hub);
|
ReleaseHub(hub);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user