summaryrefslogtreecommitdiffstats
path: root/crypto/bn/bn_word.c
diff options
context:
space:
mode:
authorBodo Möller <bodo@openssl.org>2000-09-04 15:30:14 +0000
committerBodo Möller <bodo@openssl.org>2000-09-04 15:30:14 +0000
commit5e386163801a248063afbc9e346ab1b098356729 (patch)
tree04df94506c98e4675156e9db6a193a9cb5ba7bef /crypto/bn/bn_word.c
parent54705b399263b7cc93b037dd77e94eadfeee068e (diff)
Fix for BN_mul_word(a, 0).
Diffstat (limited to 'crypto/bn/bn_word.c')
-rw-r--r--crypto/bn/bn_word.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/crypto/bn/bn_word.c b/crypto/bn/bn_word.c
index f3bdde969c..cd59baa2c4 100644
--- a/crypto/bn/bn_word.c
+++ b/crypto/bn/bn_word.c
@@ -182,11 +182,16 @@ int BN_mul_word(BIGNUM *a, BN_ULONG w)
w&=BN_MASK2;
if (a->top)
{
- ll=bn_mul_words(a->d,a->d,a->top,w);
- if (ll)
+ if (w == 0)
+ BN_zero(a);
+ else
{
- if (bn_wexpand(a,a->top+1) == NULL) return(0);
- a->d[a->top++]=ll;
+ ll=bn_mul_words(a->d,a->d,a->top,w);
+ if (ll)
+ {
+ if (bn_wexpand(a,a->top+1) == NULL) return(0);
+ a->d[a->top++]=ll;
+ }
}
}
return(1);