summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortb <tb@openbsd.org>2021-01-22 15:54:32 +0000
committertb <tb@openbsd.org>2021-01-22 15:54:32 +0000
commit3fb767b43b9c2647a4bce0ed5581b11d5e47074d (patch)
tree6032b30dcbfe68602cfd1d80a9f590698ebeb3c8
parentPrivate functions in the kernel do not to be prototyped. (diff)
downloadwireguard-openbsd-3fb767b43b9c2647a4bce0ed5581b11d5e47074d.tar.xz
wireguard-openbsd-3fb767b43b9c2647a4bce0ed5581b11d5e47074d.zip
Avoid NULL deref on BIO_new{_mem_buf,}() failure.
-rw-r--r--regress/lib/libssl/client/clienttest.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/regress/lib/libssl/client/clienttest.c b/regress/lib/libssl/client/clienttest.c
index be9ebc1d30e..51b23986fd1 100644
--- a/regress/lib/libssl/client/clienttest.c
+++ b/regress/lib/libssl/client/clienttest.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clienttest.c,v 1.26 2020/11/19 09:35:50 tb Exp $ */
+/* $OpenBSD: clienttest.c,v 1.27 2021/01/22 15:54:32 tb Exp $ */
/*
* Copyright (c) 2015 Joel Sing <jsing@openbsd.org>
*
@@ -456,8 +456,10 @@ client_hello_test(int testno, struct client_hello_test *cht)
SSL_CTX_free(ssl_ctx);
SSL_free(ssl);
- rbio->references = 1;
- wbio->references = 1;
+ if (rbio != NULL)
+ rbio->references = 1;
+ if (wbio != NULL)
+ wbio->references = 1;
BIO_free(rbio);
BIO_free(wbio);