mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 02:37:28 +02:00
Release Fixes
1. The RNG internal state could be a memory leak if the seed generate test fails. If the seed test fails, you have bigger problems.
This commit is contained in:
@ -772,6 +772,11 @@ static int _InitRng(WC_RNG* rng, byte* nonce, word32 nonceSz,
|
||||
|
||||
if (ret == DRBG_SUCCESS)
|
||||
ret = Hash_DRBG_Generate(rng->drbg, NULL, 0);
|
||||
|
||||
if (ret != DRBG_SUCCESS) {
|
||||
XFREE(rng->drbg, rng->heap, DYNAMIC_TYPE_RNG);
|
||||
rng->drbg = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
ForceZero(seed, seedSz);
|
||||
|
Reference in New Issue
Block a user