Merge pull request #522 from JacobBarthelmeh/master

help static analysis tools
This commit is contained in:
toddouska
2016-08-10 16:37:16 -07:00
committed by GitHub
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 */