Problem: bn_mul_normal() misbehaves if the size of b is 0.

Solution: multiply a with 0, putting the result in r, and return.
This commit is contained in:
Richard Levitte 2000-12-13 15:29:29 +00:00
parent 765e531159
commit 53b407da84

View File

@ -1110,6 +1110,12 @@ void bn_mul_normal(BN_ULONG *r, BN_ULONG *a, int na, BN_ULONG *b, int nb)
} }
rr= &(r[na]); rr= &(r[na]);
if (nb <= 0)
{
(void)bn_mul_words(r,a,na,0);
return;
}
else
rr[0]=bn_mul_words(r,a,na,b[0]); rr[0]=bn_mul_words(r,a,na,b[0]);
for (;;) for (;;)