diff options
| author | beck <> | 2015-10-16 14:23:22 +0000 |
|---|---|---|
| committer | beck <> | 2015-10-16 14:23:22 +0000 |
| commit | 23c7c917835b3cb6a137746bf64458e6cd4fbe84 (patch) | |
| tree | fc5fb3494bce81dd4de124060210eeb08db72d3d /src/lib/libssl/ssl_lib.c | |
| parent | 15ed40ef17caead4dfcb589dd06b92f03bd27cdb (diff) | |
| download | openbsd-23c7c917835b3cb6a137746bf64458e6cd4fbe84.tar.gz openbsd-23c7c917835b3cb6a137746bf64458e6cd4fbe84.tar.bz2 openbsd-23c7c917835b3cb6a137746bf64458e6cd4fbe84.zip | |
Fix use of pointer value after BIO_free, and remove senseless NULL checks.
ok bcook@
Diffstat (limited to 'src/lib/libssl/ssl_lib.c')
| -rw-r--r-- | src/lib/libssl/ssl_lib.c | 15 |
1 files changed, 8 insertions, 7 deletions
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 @@ | |||
| 1 | /* $OpenBSD: ssl_lib.c,v 1.113 2015/10/03 06:47:32 doug Exp $ */ | 1 | /* $OpenBSD: ssl_lib.c,v 1.114 2015/10/16 14:23:22 beck Exp $ */ |
| 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * | 4 | * |
| @@ -502,10 +502,10 @@ SSL_free(SSL *s) | |||
| 502 | BIO_free(s->bbio); | 502 | BIO_free(s->bbio); |
| 503 | s->bbio = NULL; | 503 | s->bbio = NULL; |
| 504 | } | 504 | } |
| 505 | if (s->rbio != NULL) | 505 | |
| 506 | BIO_free_all(s->rbio); | 506 | if (s->wbio != s->rbio) |
| 507 | if ((s->wbio != NULL) && (s->wbio != s->rbio)) | ||
| 508 | BIO_free_all(s->wbio); | 507 | BIO_free_all(s->wbio); |
| 508 | BIO_free_all(s->rbio); | ||
| 509 | 509 | ||
| 510 | if (s->init_buf != NULL) | 510 | if (s->init_buf != NULL) |
| 511 | BUF_MEM_free(s->init_buf); | 511 | BUF_MEM_free(s->init_buf); |
| @@ -571,10 +571,11 @@ SSL_set_bio(SSL *s, BIO *rbio, BIO *wbio) | |||
| 571 | s->bbio->next_bio = NULL; | 571 | s->bbio->next_bio = NULL; |
| 572 | } | 572 | } |
| 573 | } | 573 | } |
| 574 | if ((s->rbio != NULL) && (s->rbio != rbio)) | 574 | |
| 575 | BIO_free_all(s->rbio); | 575 | if ((s->wbio != wbio) && (s->rbio != s->wbio)) |
| 576 | if ((s->wbio != NULL) && (s->wbio != wbio) && (s->rbio != s->wbio)) | ||
| 577 | BIO_free_all(s->wbio); | 576 | BIO_free_all(s->wbio); |
| 577 | if (s->rbio != rbio) | ||
| 578 | BIO_free_all(s->rbio); | ||
| 578 | s->rbio = rbio; | 579 | s->rbio = rbio; |
| 579 | s->wbio = wbio; | 580 | s->wbio = wbio; |
| 580 | } | 581 | } |
