1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-11-22 17:39:53 +03:00

Merge PR #641: resolve several issues found by coverity

This commit is contained in:
Davide Beatrici 2018-08-12 12:28:49 +02:00 committed by GitHub
commit d3fc90f4e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 8 additions and 14 deletions

View File

@ -8941,14 +8941,8 @@ bool CtSetPassword(CLIENT *c, RPC_CLIENT_PASSWORD *pass)
{
return false;
}
if (pass->Password == NULL)
{
str = "";
}
else
{
str = pass->Password;
}
str = pass->Password;
if (StrCmp(str, "********") != 0)
{

View File

@ -6098,7 +6098,7 @@ void IntoTrafficLimiter(TRAFFIC_LIMITER *tr, PKT *p)
}
// Value increase
tr->Value += (UINT64)(p->PacketSize * 8);
tr->Value += p->PacketSize * (UINT64)8;
}
// The bandwidth reduction by traffic limiter

View File

@ -2792,7 +2792,7 @@ IPSECSA *NewIPsecSa(IKE_SERVER *ike, IKE_CLIENT *c, IKE_SA *ike_sa, bool initiat
// Set the expiration time
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->ExpiresSoftTick = ike->Now + span;
//sa->ExpiresSoftTick = ike->Now + (UINT64)5000;

View File

@ -775,7 +775,7 @@ bool PPPParseUsername(CEDAR *cedar, char *src_username, ETHERIP_ID *dst)
char src[MAX_SIZE];
// Validate arguments
Zero(dst, sizeof(ETHERIP_ID));
if (cedar == NULL || src == NULL || dst == NULL)
if (cedar == NULL || dst == NULL)
{
return false;
}
@ -1318,7 +1318,7 @@ PPP_PACKET *PPPProcessRequestPacket(PPP_SESSION *p, PPP_PACKET *req)
t = 1;
}
p->DhcpRenewInterval = (UINT64)(t * 1000);
p->DhcpRenewInterval = t * (UINT64)1000;
p->DhcpNextRenewTime = Tick64() + p->DhcpRenewInterval;
if (true)

View File

@ -209,7 +209,7 @@ void SessionMain(SESSION *s)
s->LastCommTime = Tick64();
if (s->ServerMode == false)
{
s->NextConnectionTime = Tick64() + (UINT64)(s->ClientOption->AdditionalConnectionInterval * 1000);
s->NextConnectionTime = Tick64() + s->ClientOption->AdditionalConnectionInterval * (UINT64)1000;
}
s->NumConnectionsEstablished++;

View File

@ -133,7 +133,7 @@ void BackupCfgWEx(CFG_RW *rw, FOLDER *f, wchar_t *original, UINT revision_number
wchar_t datestr[MAX_PATH];
SYSTEMTIME st;
// Validate arguments
if (f == NULL || filename == NULL || rw == NULL)
if (f == NULL || rw == NULL)
{
return;
}