Make sure BN_sqr can never return a negative value.

PR#3410
This commit is contained in:
Huzaifa Sidhpurwala 2014-06-26 23:45:58 +01:00 committed by Dr. Stephen Henson
parent 7be6b27aaf
commit 3b3b69ab25

View File

@ -77,6 +77,7 @@ int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx)
if (al <= 0)
{
r->top=0;
r->neg = 0;
return 1;
}