summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormiod <>2015-02-14 15:13:24 +0000
committermiod <>2015-02-14 15:13:24 +0000
commit88eecd145c903035d467afe311d5b54016dc5280 (patch)
tree0bf0a9f6e17909bd4d65e4ffbf98188b25272628
parent3d65de15766e3a723255b724e69359a9711bc115 (diff)
downloadopenbsd-88eecd145c903035d467afe311d5b54016dc5280.tar.gz
openbsd-88eecd145c903035d467afe311d5b54016dc5280.tar.bz2
openbsd-88eecd145c903035d467afe311d5b54016dc5280.zip
Potential NULL dereference in the error path; Coverity CID 21720
ok doug@ jsing@
-rw-r--r--src/lib/libcrypto/bn/bn_exp.c4
-rw-r--r--src/lib/libssl/src/crypto/bn/bn_exp.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/libcrypto/bn/bn_exp.c b/src/lib/libcrypto/bn/bn_exp.c
index eecab5163b..12de0c5a12 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.20 2015/02/09 15:49:22 jsing Exp $ */ 1/* $OpenBSD: bn_exp.c,v 1.21 2015/02/14 15:13:24 miod 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 *
@@ -164,7 +164,7 @@ BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
164 ret = 1; 164 ret = 1;
165 165
166err: 166err:
167 if (r != rr) 167 if (r != rr && rr != NULL)
168 BN_copy(r, rr); 168 BN_copy(r, rr);
169 BN_CTX_end(ctx); 169 BN_CTX_end(ctx);
170 bn_check_top(r); 170 bn_check_top(r);
diff --git a/src/lib/libssl/src/crypto/bn/bn_exp.c b/src/lib/libssl/src/crypto/bn/bn_exp.c
index eecab5163b..12de0c5a12 100644
--- a/src/lib/libssl/src/crypto/bn/bn_exp.c
+++ b/src/lib/libssl/src/crypto/bn/bn_exp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_exp.c,v 1.20 2015/02/09 15:49:22 jsing Exp $ */ 1/* $OpenBSD: bn_exp.c,v 1.21 2015/02/14 15:13:24 miod 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 *
@@ -164,7 +164,7 @@ BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
164 ret = 1; 164 ret = 1;
165 165
166err: 166err:
167 if (r != rr) 167 if (r != rr && rr != NULL)
168 BN_copy(r, rr); 168 BN_copy(r, rr);
169 BN_CTX_end(ctx); 169 BN_CTX_end(ctx);
170 bn_check_top(r); 170 bn_check_top(r);