From: David Asraf Date: Wed, 23 Jan 2019 11:10:11 +0000 (+0000) Subject: crypto/bn: fix return value in BN_generate_prime X-Git-Tag: openssl-3.0.0-alpha1~2608 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=3d43f9c809e42b960be94f2f4490d6d14e063486;p=oweals%2Fopenssl.git crypto/bn: fix return value in BN_generate_prime When the ret parameter is NULL the generated prime is in rnd variable and not in ret. CLA: trivial Reviewed-by: Nicola Tuveri Reviewed-by: Paul Dale Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/8076) --- diff --git a/crypto/bn/bn_depr.c b/crypto/bn/bn_depr.c index 705ca1e0a9..2ff0eedd22 100644 --- a/crypto/bn/bn_depr.c +++ b/crypto/bn/bn_depr.c @@ -40,7 +40,7 @@ BIGNUM *BN_generate_prime(BIGNUM *ret, int bits, int safe, goto err; /* we have a prime :-) */ - return ret; + return rnd; err: BN_free(rnd); return NULL;