mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-07-05 12:20:52 +02:00
Confirm rng pointer is not NULL before dereferencing it in wc_rng_new_ex.
Fixes F-3979.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user