From: Richard Levitte Date: Mon, 14 Oct 2002 11:27:16 +0000 (+0000) Subject: When BN_add_word() reaches top, it shouldn't try to add the the corresponding X-Git-Tag: OpenSSL_0_9_7-beta4~116 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=09db11783d38bb4ddbc33f40301cc0dc61ec842c;p=oweals%2Fopenssl.git When BN_add_word() reaches top, it shouldn't try to add the the corresponding word, since that word may not be zero. --- diff --git a/crypto/bn/bn_word.c b/crypto/bn/bn_word.c index cd59baa2c4..988e0ca7b3 100644 --- a/crypto/bn/bn_word.c +++ b/crypto/bn/bn_word.c @@ -123,7 +123,10 @@ int BN_add_word(BIGNUM *a, BN_ULONG w) i=0; for (;;) { - l=(a->d[i]+(BN_ULONG)w)&BN_MASK2; + if (i >= a->top) + l=w; + else + l=(a->d[i]+(BN_ULONG)w)&BN_MASK2; a->d[i]=l; if (w > l) w=1;