]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix analyzer review failure in rpz action override code to not
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Fri, 5 Nov 2021 11:02:50 +0000 (12:02 +0100)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Fri, 5 Nov 2021 11:02:50 +0000 (12:02 +0100)
  crash on unlocking the local zone lock.

doc/Changelog
services/rpz.c

index 4d4a6a5699abcaf74b09ee640a6ad73033aa4cc9..eb6fec0b0f2b592500d2be29a91c6174ba54f5f2 100644 (file)
@@ -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.
index 434660686bbe3685b81eae20e57f59b8604ccddc..6c1fb330f063f03c3ba5a5c59f5a0e1bb178f466 100644 (file)
@@ -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;