Merge pull request #5212 from kaleb-himes/various-warnings

Fix various warnings and an uninitialized XFILE
This commit is contained in:
David Garske
2022-06-04 17:10:17 -07:00
committed by GitHub
3 changed files with 4 additions and 4 deletions

View File

@ -544,7 +544,7 @@ static int ClientBenchmarkConnections(WOLFSSL_CTX* ctx, char* host, word16 port,
int version, int earlyData)
{
/* time passed in number of connects give average */
int times = benchmark, skip = times * 0.1;
int times = benchmark, skip = (int)((double)times * 0.1);
int loops = resumeSession ? 2 : 1;
int i = 0, err, ret;
#ifndef NO_SESSION_CACHE

View File

@ -335,7 +335,7 @@ static int sockAddrEqual(
if (a->ss_family == AF_INET) {
if (aLen < sizeof(SOCKADDR_IN))
if (aLen < (XSOCKLENT)sizeof(SOCKADDR_IN))
return 0;
if (((SOCKADDR_IN*)a)->sin_port != ((SOCKADDR_IN*)b)->sin_port)
@ -352,7 +352,7 @@ static int sockAddrEqual(
if (a->ss_family == AF_INET6) {
SOCKADDR_IN6 *a6, *b6;
if (aLen < sizeof(SOCKADDR_IN6))
if (aLen < (XSOCKLENT)sizeof(SOCKADDR_IN6))
return 0;
a6 = (SOCKADDR_IN6*)a;

View File

@ -20654,7 +20654,7 @@ int wc_PemPubKeyToDer_ex(const char* fileName, DerBuffer** der)
int dynamic = 0;
int ret = 0;
long sz = 0;
XFILE file;
XFILE file = NULL;
WOLFSSL_ENTER("wc_PemPubKeyToDer");