From: Bodo Möller Date: Tue, 19 Sep 2006 10:00:29 +0000 (+0000) Subject: Ensure that the addition mods[i]+delta cannot overflow in probable_prime(). X-Git-Tag: OpenSSL_0_9_7l~4 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d9d294463e9d5309336ac4f3d7a5a3e25555c0a2;p=oweals%2Fopenssl.git Ensure that the addition mods[i]+delta cannot overflow in probable_prime(). [Problem pointed out by Adam Young ] --- diff --git a/crypto/bn/bn_prime.c b/crypto/bn/bn_prime.c index e072d9255c..e03c246102 100644 --- a/crypto/bn/bn_prime.c +++ b/crypto/bn/bn_prime.c @@ -350,13 +350,14 @@ static int probable_prime(BIGNUM *rnd, int bits) { int i; BN_ULONG mods[NUMPRIMES]; - BN_ULONG delta,d; + BN_ULONG delta,maxdelta; again: if (!BN_rand(rnd,bits,1,1)) return(0); /* we now have a random number 'rand' to test. */ for (i=1; i maxdelta) goto again; goto loop; } }