From 07d93f176df0ba098a672c05117c2f35de267df7 Mon Sep 17 00:00:00 2001 From: Aram Sargsyan Date: Tue, 26 Aug 2025 15:23:17 +0000 Subject: [PATCH] Add INSISTs in configure_rpz() The 'scan-build' job in the CI reports a false positive: /* 2705 * We are reusing the old rpzs, so it can no longer be its 2704 * first time. 2707 */ 2708 pview->rpzs->first_time = false; >> Access to field 'first_time' results in a dereference of a null pointer (loaded from field 'rpzs') Add INSISTs to silence the report. --- bin/named/server.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/named/server.c b/bin/named/server.c index 9da02cf4fa..a451171dca 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -2697,6 +2697,8 @@ configure_rpz(dns_view_t *view, dns_view_t *pview, const cfg_obj_t **maps, } if (*old_rpz_okp) { + INSIST(pview->rpzs != NULL); + /* Discard the newly created rpzs. */ dns_rpz_zones_shutdown(view->rpzs); dns_rpz_zones_detach(&view->rpzs); @@ -2711,6 +2713,8 @@ configure_rpz(dns_view_t *view, dns_view_t *pview, const cfg_obj_t **maps, dns_rpz_zones_attach(pview->rpzs, &view->rpzs); dns_rpz_zones_detach(&pview->rpzs); } else if (old != NULL && pview != NULL) { + INSIST(pview->rpzs != NULL); + ++pview->rpzs->rpz_ver; view->rpzs->rpz_ver = pview->rpzs->rpz_ver; cfg_obj_log(rpz_obj, named_g_lctx, DNS_RPZ_DEBUG_LEVEL1,