From 1b5819fb2f1eca1ef6a58a9a3c8a6cd6291a6c17 Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Fri, 28 Aug 2015 20:32:34 -0400 Subject: Avoid a crash in the TLS server if the client sends ALPN but no next protocol handler was specified to the Server constructor. GH #252 --- src/lib/tls/tls_server.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib/tls/tls_server.cpp') diff --git a/src/lib/tls/tls_server.cpp b/src/lib/tls/tls_server.cpp index 2f5a0e00d..330135e63 100644 --- a/src/lib/tls/tls_server.cpp +++ b/src/lib/tls/tls_server.cpp @@ -371,7 +371,7 @@ void Server::process_handshake_msg(const Handshake_State* active_state, catch(...) {} m_next_protocol = ""; - if(state.client_hello()->supports_alpn()) + if(m_choose_next_protocol && state.client_hello()->supports_alpn()) m_next_protocol = m_choose_next_protocol(state.client_hello()->next_protocols()); if(resuming) -- cgit v1.2.3