From ce38bb1a8c68db205069dc4595afcd02594c9d98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ulf=20M=C3=B6ller?= Date: Sat, 6 Dec 2003 11:39:37 +0000 Subject: [PATCH] Avoid segfault if ret==0. Submitted by: Nils Larsch --- crypto/bn/bn_gcd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crypto/bn/bn_gcd.c b/crypto/bn/bn_gcd.c index f02e6fcdb..0248753f6 100644 --- a/crypto/bn/bn_gcd.c +++ b/crypto/bn/bn_gcd.c @@ -488,6 +488,7 @@ BIGNUM *BN_mod_inverse(BIGNUM *in, err: if ((ret == NULL) && (in == NULL)) BN_free(R); BN_CTX_end(ctx); - bn_check_top(ret); + if (ret) + bn_check_top(ret); return(ret); }