1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-11-23 01:49:53 +03:00

Merge PR #650: resolve several issues identified by coverity

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

View File

@ -276,7 +276,7 @@ UINT EcConnect(char *host, UINT port, char *password, RPC **rpc)
// RPC server function
PACK *ElRpcServer(RPC *r, char *name, PACK *p)
{
EL *e = (EL *)r->Param;
EL *e;
PACK *ret;
UINT err;
bool ok;
@ -286,6 +286,7 @@ PACK *ElRpcServer(RPC *r, char *name, PACK *p)
return NULL;
}
e = (EL *)r->Param;
ret = NewPack();
err = ERR_NO_ERROR;
ok = false;

View File

@ -299,7 +299,7 @@ RPC *NatAdminConnect(CEDAR *cedar, char *hostname, UINT port, void *hashed_passw
// RPC server function
PACK *NiRpcServer(RPC *r, char *name, PACK *p)
{
NAT *n = (NAT *)r->Param;
NAT *n;
PACK *ret;
UINT err;
bool ok;
@ -309,6 +309,7 @@ PACK *NiRpcServer(RPC *r, char *name, PACK *p)
return NULL;
}
n = (NAT *)r->Param;
ret = NewPack();
err = ERR_NO_ERROR;
ok = false;

View File

@ -1006,7 +1006,7 @@ void ClientAdditionalConnectChance(SESSION *s)
(s->NextConnectionTime <= now))
{
// Start the work to put an additional connection
s->NextConnectionTime = now + (UINT64)(s->ClientOption->AdditionalConnectionInterval * 1000);
s->NextConnectionTime = now + s->ClientOption->AdditionalConnectionInterval * (UINT64)1000U;
SessionAdditionalConnect(s);
}
else

View File

@ -133,11 +133,10 @@ static EVENT *halt_tick_event = NULL;
// Get the high-resolution time
UINT64 TickHighres64()
{
UINT64 ret = 0;
#ifdef OS_WIN32
ret = (UINT64)(MsGetHiResTimeSpan(MsGetHiResCounter()) * 1000.0f);
return (UINT64)(MsGetHiResTimeSpan(MsGetHiResCounter()) * 1000.0f);
#else // OS_WIN32
@ -145,7 +144,6 @@ UINT64 TickHighres64()
#endif // OS_WIN32
return ret;
}
// Convert the Tick value to time