From a257720ff1fc941f32aec3258685e6ae8d66fb92 Mon Sep 17 00:00:00 2001 From: beck <> Date: Fri, 16 Oct 2015 14:23:22 +0000 Subject: Fix use of pointer value after BIO_free, and remove senseless NULL checks. ok bcook@ --- src/lib/libssl/src/ssl/ssl_lib.c | 15 ++++++++------- src/lib/libssl/ssl_lib.c | 15 ++++++++------- 2 files changed, 16 insertions(+), 14 deletions(-) (limited to 'src/lib') diff --git a/src/lib/libssl/src/ssl/ssl_lib.c b/src/lib/libssl/src/ssl/ssl_lib.c index 0b094e8db6..6479f729e7 100644 --- a/src/lib/libssl/src/ssl/ssl_lib.c +++ b/src/lib/libssl/src/ssl/ssl_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_lib.c,v 1.113 2015/10/03 06:47:32 doug Exp $ */ +/* $OpenBSD: ssl_lib.c,v 1.114 2015/10/16 14:23:22 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -502,10 +502,10 @@ SSL_free(SSL *s) BIO_free(s->bbio); s->bbio = NULL; } - if (s->rbio != NULL) - BIO_free_all(s->rbio); - if ((s->wbio != NULL) && (s->wbio != s->rbio)) + + if (s->wbio != s->rbio) BIO_free_all(s->wbio); + BIO_free_all(s->rbio); if (s->init_buf != NULL) BUF_MEM_free(s->init_buf); @@ -571,10 +571,11 @@ SSL_set_bio(SSL *s, BIO *rbio, BIO *wbio) s->bbio->next_bio = NULL; } } - if ((s->rbio != NULL) && (s->rbio != rbio)) - BIO_free_all(s->rbio); - if ((s->wbio != NULL) && (s->wbio != wbio) && (s->rbio != s->wbio)) + + if ((s->wbio != wbio) && (s->rbio != s->wbio)) BIO_free_all(s->wbio); + if (s->rbio != rbio) + BIO_free_all(s->rbio); s->rbio = rbio; s->wbio = wbio; } diff --git a/src/lib/libssl/ssl_lib.c b/src/lib/libssl/ssl_lib.c index 0b094e8db6..6479f729e7 100644 --- a/src/lib/libssl/ssl_lib.c +++ b/src/lib/libssl/ssl_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_lib.c,v 1.113 2015/10/03 06:47:32 doug Exp $ */ +/* $OpenBSD: ssl_lib.c,v 1.114 2015/10/16 14:23:22 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -502,10 +502,10 @@ SSL_free(SSL *s) BIO_free(s->bbio); s->bbio = NULL; } - if (s->rbio != NULL) - BIO_free_all(s->rbio); - if ((s->wbio != NULL) && (s->wbio != s->rbio)) + + if (s->wbio != s->rbio) BIO_free_all(s->wbio); + BIO_free_all(s->rbio); if (s->init_buf != NULL) BUF_MEM_free(s->init_buf); @@ -571,10 +571,11 @@ SSL_set_bio(SSL *s, BIO *rbio, BIO *wbio) s->bbio->next_bio = NULL; } } - if ((s->rbio != NULL) && (s->rbio != rbio)) - BIO_free_all(s->rbio); - if ((s->wbio != NULL) && (s->wbio != wbio) && (s->rbio != s->wbio)) + + if ((s->wbio != wbio) && (s->rbio != s->wbio)) BIO_free_all(s->wbio); + if (s->rbio != rbio) + BIO_free_all(s->rbio); s->rbio = rbio; s->wbio = wbio; } -- cgit v1.2.3-55-g6feb