summaryrefslogtreecommitdiffstats
path: root/lib/libssl/src
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2015-02-14 15:13:24 +0000
committermiod <miod@openbsd.org>2015-02-14 15:13:24 +0000
commitebe756373677f810ed21a264d86f397bb3c5a581 (patch)
tree76d0566179b538638c40a9791a1a5b186dd6cda1 /lib/libssl/src
parentCoverity CID 21733 (unchecked allocation), 78823 (leak on error). (diff)
downloadwireguard-openbsd-ebe756373677f810ed21a264d86f397bb3c5a581.tar.xz
wireguard-openbsd-ebe756373677f810ed21a264d86f397bb3c5a581.zip
Potential NULL dereference in the error path; Coverity CID 21720
ok doug@ jsing@
Diffstat (limited to 'lib/libssl/src')
-rw-r--r--lib/libssl/src/crypto/bn/bn_exp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libssl/src/crypto/bn/bn_exp.c b/lib/libssl/src/crypto/bn/bn_exp.c
index eecab5163b0..12de0c5a129 100644
--- a/lib/libssl/src/crypto/bn/bn_exp.c
+++ b/lib/libssl/src/crypto/bn/bn_exp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bn_exp.c,v 1.20 2015/02/09 15:49:22 jsing Exp $ */
+/* $OpenBSD: bn_exp.c,v 1.21 2015/02/14 15:13:24 miod Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -164,7 +164,7 @@ BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
ret = 1;
err:
- if (r != rr)
+ if (r != rr && rr != NULL)
BN_copy(r, rr);
BN_CTX_end(ctx);
bn_check_top(r);