Fix error handling in bn_exp
In the event of an error |rr| could be NULL. Therefore don't assume you can use |rr| in the error handling code. Reviewed-by: Andy Polyakov <appro@openssl.org> (cherry picked from commit 8c5a7b33c6269c3bd6bc0df6b4c22e4fba03b485)
This commit is contained in:
parent
f5ee521307
commit
cc27bec2b4
@ -168,10 +168,10 @@ int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
|
|||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ret = 1;
|
|
||||||
err:
|
|
||||||
if (r != rr)
|
if (r != rr)
|
||||||
BN_copy(r, rr);
|
BN_copy(r, rr);
|
||||||
|
ret = 1;
|
||||||
|
err:
|
||||||
BN_CTX_end(ctx);
|
BN_CTX_end(ctx);
|
||||||
bn_check_top(r);
|
bn_check_top(r);
|
||||||
return (ret);
|
return (ret);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user