diff options
-rw-r--r-- | crypto/bn/bn_mul.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/crypto/bn/bn_mul.c b/crypto/bn/bn_mul.c index b4ed7e23e6..94db7c05e6 100644 --- a/crypto/bn/bn_mul.c +++ b/crypto/bn/bn_mul.c @@ -1110,7 +1110,13 @@ void bn_mul_normal(BN_ULONG *r, BN_ULONG *a, int na, BN_ULONG *b, int nb) } rr= &(r[na]); - rr[0]=bn_mul_words(r,a,na,b[0]); + if (nb <= 0) + { + (void)bn_mul_words(r,a,na,0); + return; + } + else + rr[0]=bn_mul_words(r,a,na,b[0]); for (;;) { |