From 792d8a74ab5af8723ecc53a6eb20d1a47ec71b11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Sat, 14 Mar 2026 10:10:34 +0100 Subject: [PATCH] Add invariant check for delegset in rctx_nextserver() The get_nameservers path in rctx_nextserver() is only reachable from rctx_referral(), which already detaches fctx->delegset. Assert that it is NULL rather than redundantly detaching it, since dns_view_bestzonecut() requires *delegsetp == NULL. --- lib/dns/resolver.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index 11a57ca681..25ba14bd73 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -9379,6 +9379,7 @@ rctx_nextserver(respctx_t *rctx, dns_message_t *message, } else { name = fctx->domain; } + INSIST(fctx->delegset == NULL); result = dns_view_bestzonecut(fctx->res->view, name, fname, dcname, fctx->now, findoptions, true, true, &fctx->delegset);