fix static analysis warnings

This commit is contained in:
John Safranek 2014-04-29 14:52:42 -07:00
parent 2cf3564d1e
commit 09a7a087a2
3 changed files with 7 additions and 2 deletions

View File

@ -1299,6 +1299,9 @@ int ecc_make_key(RNG* rng, int keysize, ecc_key* key)
{
int x, err;
if (key == NULL || rng == NULL)
return ECC_BAD_ARG_E;
/* find key size */
for (x = 0; (keysize > ecc_sets[x].size) && (ecc_sets[x].size != 0); x++)
;

View File

@ -2036,7 +2036,6 @@ int CyaSSL_Init(void)
XFREE(der.buffer, heap, dynamicType);
return ret;
}
ret = 0; /* back to good status */
if (XSTRNCMP(info.name, "DES-CBC", 7) == 0) {
Des enc;
@ -7823,7 +7822,7 @@ int CyaSSL_set_compression(CYASSL* ssl)
break;
}
if (buf != NULL) {
if (buf != NULL && text != NULL) {
textSz = min(textSz, len);
XMEMCPY(buf, text, textSz);
buf[textSz] = '\0';

View File

@ -550,6 +550,9 @@ int TLS_hmac(CYASSL* ssl, byte* digest, const byte* in, word32 sz,
Hmac hmac;
int ret;
byte myInner[CYASSL_TLS_HMAC_INNER_SZ];
if (ssl == NULL)
return BAD_FUNC_ARG;
CyaSSL_SetTlsHmacInner(ssl, myInner, sz, content, verify);