diff options
Diffstat (limited to 'src/lib/libcrypto/bn/bn_sqr.c')
| -rw-r--r-- | src/lib/libcrypto/bn/bn_sqr.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/libcrypto/bn/bn_sqr.c b/src/lib/libcrypto/bn/bn_sqr.c index 6e784541bd..6641b77592 100644 --- a/src/lib/libcrypto/bn/bn_sqr.c +++ b/src/lib/libcrypto/bn/bn_sqr.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: bn_sqr.c,v 1.27 2023/02/17 05:13:34 jsing Exp $ */ | 1 | /* $OpenBSD: bn_sqr.c,v 1.28 2023/03/27 10:22:47 tb Exp $ */ |
| 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * | 4 | * |
| @@ -404,8 +404,10 @@ BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) | |||
| 404 | 404 | ||
| 405 | rr->neg = 0; | 405 | rr->neg = 0; |
| 406 | 406 | ||
| 407 | if (rr != r) | 407 | if (rr != r) { |
| 408 | BN_copy(r, rr); | 408 | if (!bn_copy(r, rr)) |
| 409 | goto err; | ||
| 410 | } | ||
| 409 | 411 | ||
| 410 | done: | 412 | done: |
| 411 | ret = 1; | 413 | ret = 1; |
