From 0006c08f15ba6c7c9c09d8337960cfa24904d066 Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Fri, 5 Nov 2021 12:02:50 +0100 Subject: [PATCH] - Fix analyzer review failure in rpz action override code to not crash on unlocking the local zone lock. --- doc/Changelog | 2 ++ services/rpz.c | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/Changelog b/doc/Changelog index 4d4a6a569..eb6fec0b0 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -6,6 +6,8 @@ 5 November 2021: Wouter - Fix that forward-zone name is documented as the full name of the zone. It is not relative but a fully qualified domain name. + - Fix analyzer review failure in rpz action override code to not + crash on unlocking the local zone lock. 2 November 2021: Wouter - Fix #552: Unbound assumes index.html exists on RPZ host. diff --git a/services/rpz.c b/services/rpz.c index 434660686..6c1fb330f 100644 --- a/services/rpz.c +++ b/services/rpz.c @@ -1476,8 +1476,10 @@ rpz_resolve_client_action_and_zone(struct auth_zones* az, struct query_info* qin r->action_override, qinfo, repinfo, NULL, r->log_name); stats->rpz_action[r->action_override]++; - lock_rw_unlock(&z->lock); - z = NULL; + if(z != NULL) { + lock_rw_unlock(&z->lock); + z = NULL; + } if(node != NULL) { lock_rw_unlock(&node->lock); node = NULL;