memset structures to 0 in Init functions

This commit is contained in:
Jacob Barthelmeh
2017-01-25 18:06:25 -07:00
parent 340963742a
commit 8928160df7
2 changed files with 6 additions and 0 deletions

View File

@@ -19104,6 +19104,7 @@ void wolfSSL_BN_CTX_free(WOLFSSL_BN_CTX* ctx)
static void InitwolfSSL_BigNum(WOLFSSL_BIGNUM* bn)
{
if (bn) {
XMEMSET(bn, 0, sizeof(WOLFSSL_BIGNUM));
bn->neg = 0;
bn->internal = NULL;
}
@@ -20446,6 +20447,7 @@ void wolfSSL_DSA_free(WOLFSSL_DSA* dsa)
static void InitwolfSSL_Rsa(WOLFSSL_RSA* rsa)
{
if (rsa) {
XMEMSET(rsa, 0, sizeof(WOLFSSL_RSA));
rsa->n = NULL;
rsa->e = NULL;
rsa->d = NULL;

View File

@@ -218,6 +218,10 @@ int wc_InitRsaKey_ex(RsaKey* key, void* heap, int devId)
return BAD_FUNC_ARG;
}
(void)devId;
XMEMSET(key, 0, sizeof(RsaKey));
key->type = RSA_TYPE_UNKNOWN;
key->state = RSA_STATE_NONE;
key->heap = heap;