From 3142b0bdfcb12ec46569f62d48780982a2c26f47 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Mon, 13 Oct 2014 16:51:13 +0200 Subject: [PATCH] fp_prime_random_ex: make sure call-back function is not NULL --- src/numtheory/fp_prime_random_ex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/numtheory/fp_prime_random_ex.c b/src/numtheory/fp_prime_random_ex.c index 3debce3..b9dd68e 100644 --- a/src/numtheory/fp_prime_random_ex.c +++ b/src/numtheory/fp_prime_random_ex.c @@ -16,7 +16,7 @@ int fp_prime_random_ex(fp_int *a, int t, int size, int flags, tfm_prime_callback int res, err, bsize, maskOR_msb_offset; /* sanity check the input */ - if (size <= 1 || t <= 0 || t > FP_PRIME_SIZE) { + if (size <= 1 || cb == NULL || t <= 0 || t > FP_PRIME_SIZE) { return FP_VAL; }