Commit 53b407da authored by Richard Levitte's avatar Richard Levitte
Browse files

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

Solution: multiply a with 0, putting the result in r, and return.
parent 765e5311
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -1110,6 +1110,12 @@ void bn_mul_normal(BN_ULONG *r, BN_ULONG *a, int na, BN_ULONG *b, int nb)

		}
	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]);

	for (;;)