From: Ondřej Surý Date: Mon, 19 Dec 2022 16:28:39 +0000 (+0100) Subject: Don't remove dispatches in CANCELED state from the list X-Git-Tag: v9.19.9~66^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7310e2b42454247be7580cec59b9bf1743ea9bd0;p=thirdparty%2Fbind9.git Don't remove dispatches in CANCELED state from the list In dns_dispatch_gettcp(), we can't remove canceled dispatches from the mgr->list because ISC_LIST_NEXT() would fail in the next iteration. --- diff --git a/lib/dns/dispatch.c b/lib/dns/dispatch.c index 50cdee81fad..b5923b1ed57 100644 --- a/lib/dns/dispatch.c +++ b/lib/dns/dispatch.c @@ -1265,7 +1265,7 @@ dns_dispatch_gettcp(dns_dispatchmgr_t *mgr, const isc_sockaddr_t *destaddr, { switch (disp->state) { case DNS_DISPATCHSTATE_NONE: - /* Dispatch in indeterminate state */ + /* Dispatch in indeterminate state, skip it */ break; case DNS_DISPATCHSTATE_CONNECTED: /* We found a connected dispatch */ @@ -1280,10 +1280,8 @@ dns_dispatch_gettcp(dns_dispatchmgr_t *mgr, const isc_sockaddr_t *destaddr, break; case DNS_DISPATCHSTATE_CANCELED: /* - * We found a canceled dispatch, help its - * removal from the list, and skip it. + * We found a canceled dispatch, skip it. */ - ISC_LIST_UNLINK(disp->mgr->list, disp, link); break; default: UNREACHABLE();