]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
check statichandle before attaching
authorEvan Hunt <each@isc.org>
Sun, 17 Oct 2021 20:30:47 +0000 (13:30 -0700)
committerEvan Hunt <each@isc.org>
Mon, 18 Oct 2021 21:21:04 +0000 (14:21 -0700)
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.

lib/isc/netmgr/netmgr.c

index 9b884e0a939300223a87710dca514dc887c0e35d..10b0d2345767346792b938ab7d51ba27ad4fce30 100644 (file)
@@ -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);