summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2015-08-11 19:38:39 +0100
committerMatt Caswell <matt@openssl.org>2015-08-11 22:16:38 +0100
commitf75d5171be0b3b5419c8974133e1573cf976a8bb (patch)
treedbaee1a969f938843d5a21448e35d44609550ff5
parentd8e8590ed90eba6ef651d09d77befb14f980de2c (diff)
Fix "make test" seg fault with SCTP enabled
When config'd with "sctp" running "make test" causes a seg fault. This is actually due to the way ssltest works - it dives under the covers and frees up BIOs manually and so some BIOs are NULL when the SCTP code does not expect it. The simplest fix is just to add some sanity checks to make sure the BIOs aren't NULL before we use them. This problem occurs in master and 1.0.2. The fix has also been applied to 1.0.1 to keep the code in sync. Reviewed-by: Tim Hudson <tjh@openssl.org>
-rw-r--r--ssl/d1_both.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ssl/d1_both.c b/ssl/d1_both.c
index ec47b94c75..2c3ab5423b 100644
--- a/ssl/d1_both.c
+++ b/ssl/d1_both.c
@@ -1365,9 +1365,12 @@ int dtls1_shutdown(SSL *s)
{
int ret;
#ifndef OPENSSL_NO_SCTP
- if (BIO_dgram_is_sctp(SSL_get_wbio(s)) &&
+ BIO *wbio;
+
+ wbio = SSL_get_wbio(s);
+ if (wbio != NULL && BIO_dgram_is_sctp(wbio) &&
!(s->shutdown & SSL_SENT_SHUTDOWN)) {
- ret = BIO_dgram_sctp_wait_for_dry(SSL_get_wbio(s));
+ ret = BIO_dgram_sctp_wait_for_dry(wbio);
if (ret < 0)
return -1;