help static analysis tools

pull/522/head
Jacob Barthelmeh 2016-08-10 14:23:27 -06:00
parent fd9f8125e3
commit b502d9dcf7
2 changed files with 3 additions and 2 deletions

View File

@ -1186,7 +1186,7 @@ int wc_RsaPrivateDecrypt(const byte* in, word32 inLen, byte* out, word32 outLen,
XFREE(tmp, key->heap, DYNAMIC_TYPE_RSA);
return plainLen;
}
if (plainLen > (int)outLen)
if (plainLen > (int)outLen || pad == NULL)
plainLen = BAD_FUNC_ARG;
else
XMEMCPY(out, pad, plainLen);
@ -1305,7 +1305,7 @@ int wc_RsaSSL_Verify(const byte* in, word32 inLen, byte* out, word32 outLen,
return plainLen;
}
if (plainLen > (int)outLen)
if (plainLen > (int)outLen || pad == NULL)
plainLen = BAD_FUNC_ARG;
else
XMEMCPY(out, pad, plainLen);

View File

@ -3957,6 +3957,7 @@ int memory_test(void)
return -113; /* should round to 0 since struct + bucket will not fit */
}
(void)dist; /* avoid static analysis warning of variable not used */
return 0;
}
#endif /* WOLFSSL_STATIC_MEMORY */