diff options
author | 2015-10-16 14:23:22 +0000 | |
---|---|---|
committer | 2015-10-16 14:23:22 +0000 | |
commit | 7d987d1f6d11bc901293dd3890362d76f594fa29 (patch) | |
tree | 12ea7cf81b5ca479069f003ac99fa02908b10379 /lib/libssl/ssl_lib.c | |
parent | Always allow a r/w opening of /dev/null though the namei check. This (diff) | |
download | wireguard-openbsd-7d987d1f6d11bc901293dd3890362d76f594fa29.tar.xz wireguard-openbsd-7d987d1f6d11bc901293dd3890362d76f594fa29.zip |
Fix use of pointer value after BIO_free, and remove senseless NULL checks.
ok bcook@
Diffstat (limited to 'lib/libssl/ssl_lib.c')
-rw-r--r-- | lib/libssl/ssl_lib.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/libssl/ssl_lib.c b/lib/libssl/ssl_lib.c index 0b094e8db6b..6479f729e7f 100644 --- a/lib/libssl/ssl_lib.c +++ b/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; } |