Confirm rng pointer is not NULL before dereferencing it in wc_rng_new_ex.

Fixes F-3979.
This commit is contained in:
Kareem
2026-06-04 16:40:51 -07:00
parent edf1439151
commit 8c4ad8d573
+4
View File
@@ -2175,6 +2175,10 @@ int wc_rng_new_ex(WC_RNG **rng, byte* nonce, word32 nonceSz,
{
int ret;
if (rng == NULL) {
return BAD_FUNC_ARG;
}
*rng = (WC_RNG*)XMALLOC(sizeof(WC_RNG), heap, DYNAMIC_TYPE_RNG);
if (*rng == NULL) {
return MEMORY_E;