From: Evan Hunt Date: Sun, 17 Oct 2021 20:30:47 +0000 (-0700) Subject: check statichandle before attaching X-Git-Tag: v9.17.20~38^2 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=32b50407bf0af3e4e5a6d97ce3109c79c22933db;p=thirdparty%2Fbind9.git check statichandle before attaching it is possible for udp_recv_cb() to fire after the socket is already shutting down and statichandle is NULL; we need to create a temporary handle in this case. --- diff --git a/lib/isc/netmgr/netmgr.c b/lib/isc/netmgr/netmgr.c index 9b884e0a939..10b0d234576 100644 --- a/lib/isc/netmgr/netmgr.c +++ b/lib/isc/netmgr/netmgr.c @@ -2144,7 +2144,7 @@ isc__nm_get_read_req(isc_nmsocket_t *sock, isc_sockaddr_t *sockaddr) { isc_nmhandle_attach(sock->statichandle, &req->handle); break; default: - if (atomic_load(&sock->client)) { + if (atomic_load(&sock->client) && sock->statichandle != NULL) { isc_nmhandle_attach(sock->statichandle, &req->handle); } else { req->handle = isc__nmhandle_get(sock, sockaddr, NULL);