diff options
Diffstat (limited to 'src/lib/libcrypto/bn/bn_exp.c')
-rw-r--r-- | src/lib/libcrypto/bn/bn_exp.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/libcrypto/bn/bn_exp.c b/src/lib/libcrypto/bn/bn_exp.c index 4944daa48c..b756d2b305 100644 --- a/src/lib/libcrypto/bn/bn_exp.c +++ b/src/lib/libcrypto/bn/bn_exp.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bn_exp.c,v 1.42 2023/03/27 10:21:23 tb Exp $ */ | 1 | /* $OpenBSD: bn_exp.c,v 1.43 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 | * |
@@ -165,8 +165,10 @@ BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx) | |||
165 | ret = 1; | 165 | ret = 1; |
166 | 166 | ||
167 | err: | 167 | err: |
168 | if (r != rr && rr != NULL) | 168 | if (r != rr && rr != NULL) { |
169 | BN_copy(r, rr); | 169 | if (!bn_copy(r, rr)) |
170 | ret = 0; | ||
171 | } | ||
170 | BN_CTX_end(ctx); | 172 | BN_CTX_end(ctx); |
171 | return (ret); | 173 | return (ret); |
172 | } | 174 | } |