summaryrefslogtreecommitdiff
path: root/lib/libcrypto/bn/bn_word.c
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2003-05-12 02:18:41 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2003-05-12 02:18:41 +0000
commitb47e6f30e82ff649c06cdfcf587a4ad9d127a4f5 (patch)
treef98b2f00f52dd4fd004708bd26d63f3c24a78355 /lib/libcrypto/bn/bn_word.c
parentf97744c656f2a5c7d4e42bcaba08dbe146a49425 (diff)
merge 0.9.7b with local changes; crank majors for libssl/libcrypto
Diffstat (limited to 'lib/libcrypto/bn/bn_word.c')
-rw-r--r--lib/libcrypto/bn/bn_word.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libcrypto/bn/bn_word.c b/lib/libcrypto/bn/bn_word.c
index cd59baa2c49..988e0ca7b37 100644
--- a/lib/libcrypto/bn/bn_word.c
+++ b/lib/libcrypto/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;