mirror of https://github.com/wolfSSL/wolfssl.git
Merge pull request #3192 from ethanlooney/21st_branch
Added check for wolfmath.c for digits == 0 and test for api.cpull/3211/head
commit
d12b80abdf
|
@ -33914,6 +33914,12 @@ static int test_mp_rand (void)
|
|||
ret = 0;
|
||||
}
|
||||
}
|
||||
if (ret == 0) {
|
||||
ret = mp_rand(&a, 0, &rng);
|
||||
if (ret == BAD_FUNC_ARG) {
|
||||
ret = 0;
|
||||
}
|
||||
}
|
||||
if (ret == 0) {
|
||||
ret = mp_rand(&a, digits, &rng);
|
||||
}
|
||||
|
|
|
@ -146,7 +146,7 @@ int mp_rand(mp_int* a, int digits, WC_RNG* rng)
|
|||
if (rng == NULL) {
|
||||
ret = MISSING_RNG_E;
|
||||
}
|
||||
else if (a == NULL) {
|
||||
else if (a == NULL || digits == 0) {
|
||||
ret = BAD_FUNC_ARG;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue