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.
This commit is contained in:
Aram Sargsyan 2025-08-26 15:23:17 +00:00 committed by Arаm Sаrgsyаn
parent 1dd4f95d1e
commit 07d93f176d

View file

@ -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,