X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fbn%2Fbn_sqr.c;h=44e7332acf1a9bcbabd057faf3d2892ca10c1a96;hp=a62bb1a584805d25e72a4fcb3dc2feb3157e6712;hb=78e09b53a40729f5e99829ccc733b592bd22fea1;hpb=dfc3ffe50251463b4af7deeac3d407667f9050a3 diff --git a/crypto/bn/bn_sqr.c b/crypto/bn/bn_sqr.c index a62bb1a584..44e7332acf 100644 --- a/crypto/bn/bn_sqr.c +++ b/crypto/bn/bn_sqr.c @@ -90,8 +90,9 @@ int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) rr->top = max - 1; else rr->top = max; - if (rr != r) - BN_copy(r, rr); + if (r != rr && BN_copy(r, rr) == NULL) + goto err; + ret = 1; err: bn_check_top(rr);