From 3fb767b43b9c2647a4bce0ed5581b11d5e47074d Mon Sep 17 00:00:00 2001 From: tb Date: Fri, 22 Jan 2021 15:54:32 +0000 Subject: [PATCH] Avoid NULL deref on BIO_new{_mem_buf,}() failure. --- regress/lib/libssl/client/clienttest.c | 8 +++++--- 1 file 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 * @@ -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); -- 2.20.1