diff --git a/src/internal.c b/src/internal.c index ec129d626..4ad42fdbd 100644 --- a/src/internal.c +++ b/src/internal.c @@ -2814,7 +2814,7 @@ static int MatchDomainName(const char* pattern, int len, const char* str) if (len == 0) p = '\0'; - while ( (s = (char)(*str)) ) { + while ( (s = (char)(*str)) != '\0') { if (s == p) break; if (s == '.') diff --git a/src/ssl.c b/src/ssl.c index 02f89afee..006beaf3e 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -2813,7 +2813,7 @@ int CyaSSL_SetServerID(CYASSL* ssl, const byte* id, int len, int newSession) if (session == NULL) { CYASSL_MSG("Valid ServerID not cached already"); - ssl->session.idLen = min(SERVER_ID_LEN, (word32)len); + ssl->session.idLen = (word16)min(SERVER_ID_LEN, (word32)len); XMEMCPY(ssl->session.serverID, id, ssl->session.idLen); } @@ -4510,8 +4510,8 @@ int AddSession(CYASSL* ssl) % SESSION_ROWS; clientIdx = ClientCache[clientRow].nextIdx++; - ClientCache[clientRow].Clients[clientIdx].serverRow = row; - ClientCache[clientRow].Clients[clientIdx].serverIdx = idx; + ClientCache[clientRow].Clients[clientIdx].serverRow = (word16)row; + ClientCache[clientRow].Clients[clientIdx].serverIdx = (word16)idx; ClientCache[clientRow].totalCount++; if (ClientCache[clientRow].nextIdx == SESSIONS_PER_ROW)