mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2024-11-10 03:30:39 +03:00
Merge PR #641: resolve several issues found by coverity
This commit is contained in:
commit
d3fc90f4e0
@ -8941,14 +8941,8 @@ bool CtSetPassword(CLIENT *c, RPC_CLIENT_PASSWORD *pass)
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (pass->Password == NULL)
|
|
||||||
{
|
str = pass->Password;
|
||||||
str = "";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
str = pass->Password;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (StrCmp(str, "********") != 0)
|
if (StrCmp(str, "********") != 0)
|
||||||
{
|
{
|
||||||
|
@ -6098,7 +6098,7 @@ void IntoTrafficLimiter(TRAFFIC_LIMITER *tr, PKT *p)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Value increase
|
// Value increase
|
||||||
tr->Value += (UINT64)(p->PacketSize * 8);
|
tr->Value += p->PacketSize * (UINT64)8;
|
||||||
}
|
}
|
||||||
|
|
||||||
// The bandwidth reduction by traffic limiter
|
// The bandwidth reduction by traffic limiter
|
||||||
|
@ -2792,7 +2792,7 @@ IPSECSA *NewIPsecSa(IKE_SERVER *ike, IKE_CLIENT *c, IKE_SA *ike_sa, bool initiat
|
|||||||
// Set the expiration time
|
// Set the expiration time
|
||||||
if (setting->LifeSeconds != 0)
|
if (setting->LifeSeconds != 0)
|
||||||
{
|
{
|
||||||
UINT64 span = (UINT64)(setting->LifeSeconds * 1000) + (UINT64)IKE_SOFT_EXPIRES_MARGIN;
|
UINT64 span = setting->LifeSeconds * (UINT64)1000 + (UINT64)IKE_SOFT_EXPIRES_MARGIN;
|
||||||
sa->ExpiresHardTick = ike->Now + span;
|
sa->ExpiresHardTick = ike->Now + span;
|
||||||
sa->ExpiresSoftTick = ike->Now + span;
|
sa->ExpiresSoftTick = ike->Now + span;
|
||||||
//sa->ExpiresSoftTick = ike->Now + (UINT64)5000;
|
//sa->ExpiresSoftTick = ike->Now + (UINT64)5000;
|
||||||
|
@ -775,7 +775,7 @@ bool PPPParseUsername(CEDAR *cedar, char *src_username, ETHERIP_ID *dst)
|
|||||||
char src[MAX_SIZE];
|
char src[MAX_SIZE];
|
||||||
// Validate arguments
|
// Validate arguments
|
||||||
Zero(dst, sizeof(ETHERIP_ID));
|
Zero(dst, sizeof(ETHERIP_ID));
|
||||||
if (cedar == NULL || src == NULL || dst == NULL)
|
if (cedar == NULL || dst == NULL)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1318,7 +1318,7 @@ PPP_PACKET *PPPProcessRequestPacket(PPP_SESSION *p, PPP_PACKET *req)
|
|||||||
t = 1;
|
t = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
p->DhcpRenewInterval = (UINT64)(t * 1000);
|
p->DhcpRenewInterval = t * (UINT64)1000;
|
||||||
p->DhcpNextRenewTime = Tick64() + p->DhcpRenewInterval;
|
p->DhcpNextRenewTime = Tick64() + p->DhcpRenewInterval;
|
||||||
|
|
||||||
if (true)
|
if (true)
|
||||||
|
@ -209,7 +209,7 @@ void SessionMain(SESSION *s)
|
|||||||
s->LastCommTime = Tick64();
|
s->LastCommTime = Tick64();
|
||||||
if (s->ServerMode == false)
|
if (s->ServerMode == false)
|
||||||
{
|
{
|
||||||
s->NextConnectionTime = Tick64() + (UINT64)(s->ClientOption->AdditionalConnectionInterval * 1000);
|
s->NextConnectionTime = Tick64() + s->ClientOption->AdditionalConnectionInterval * (UINT64)1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
s->NumConnectionsEstablished++;
|
s->NumConnectionsEstablished++;
|
||||||
|
@ -133,7 +133,7 @@ void BackupCfgWEx(CFG_RW *rw, FOLDER *f, wchar_t *original, UINT revision_number
|
|||||||
wchar_t datestr[MAX_PATH];
|
wchar_t datestr[MAX_PATH];
|
||||||
SYSTEMTIME st;
|
SYSTEMTIME st;
|
||||||
// Validate arguments
|
// Validate arguments
|
||||||
if (f == NULL || filename == NULL || rw == NULL)
|
if (f == NULL || rw == NULL)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user