mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-29 18:27:29 +02:00
Add parameter check
This commit is contained in:
@ -914,7 +914,7 @@ int wc_RNG_GenerateBlock(WC_RNG* rng, byte* output, word32 sz)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (rng == NULL || output == NULL)
|
||||
if (rng == NULL || output == NULL || sz == 0 )
|
||||
return BAD_FUNC_ARG;
|
||||
|
||||
#ifdef WOLF_CRYPTO_CB
|
||||
|
@ -12979,7 +12979,7 @@ int sp_rand_prime(sp_int* r, int len, WC_RNG* rng, void* heap)
|
||||
|
||||
(void)heap;
|
||||
|
||||
if ((r == NULL) || (rng == NULL)) {
|
||||
if ((r == NULL) || (rng == NULL) || len <= 0 ) {
|
||||
err = MP_VAL;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user