diff options
author | Richard Levitte <levitte@openssl.org> | 2002-10-14 11:33:32 +0000 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2002-10-14 11:33:32 +0000 |
commit | e15ea3d9e1e58a4387c7287110d8834f6db5466c (patch) | |
tree | df7e176bc9b85a67c8eaa725f3869db9a1d5def0 /crypto | |
parent | 677532629d84e39f4cb8edfe017fbfc8120d45d0 (diff) | |
download | openssl-e15ea3d9e1e58a4387c7287110d8834f6db5466c.zip openssl-e15ea3d9e1e58a4387c7287110d8834f6db5466c.tar.gz openssl-e15ea3d9e1e58a4387c7287110d8834f6db5466c.tar.bz2 |
When BN_add_word() reaches top, it shouldn't try to add the the corresponding
word, since that word may not be zero.
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/bn/bn_word.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/crypto/bn/bn_word.c b/crypto/bn/bn_word.c index cd59baa..988e0ca 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; |