From: tb Date: Fri, 22 Jan 2021 15:54:32 +0000 (+0000) Subject: Avoid NULL deref on BIO_new{_mem_buf,}() failure. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=3fb767b43b9c2647a4bce0ed5581b11d5e47074d;p=openbsd Avoid NULL deref on BIO_new{_mem_buf,}() failure. --- 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);