From: Artem Boldariev Date: Tue, 18 Oct 2022 11:42:10 +0000 (+0300) Subject: TLS Stream: handle successful TLS handshake after listener shutdown X-Git-Tag: v9.19.7~47^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=09dcc914b4c54d97d776c3f21b84ed842eda9206;p=thirdparty%2Fbind9.git TLS Stream: handle successful TLS handshake after listener shutdown It was possible that accept callback can be called after listener shutdown. In such a case the callback pointer equals NULL, leading to segmentation fault. This commit fixes that. --- diff --git a/lib/isc/netmgr/tlsstream.c b/lib/isc/netmgr/tlsstream.c index d99e842ca34..35fa09fec2c 100644 --- a/lib/isc/netmgr/tlsstream.c +++ b/lib/isc/netmgr/tlsstream.c @@ -341,7 +341,7 @@ tls_try_handshake(isc_nmsocket_t *sock, isc_result_t *presult) { isc__nmsocket_log_tls_session_reuse(sock, sock->tlsstream.tls); tlshandle = isc__nmhandle_get(sock, &sock->peer, &sock->iface); if (sock->tlsstream.server) { - if (sock->listener->accept_cb == NULL) { + if (isc__nmsocket_closing(sock->listener)) { result = ISC_R_CANCELED; } else { result = sock->listener->accept_cb(