]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- rpz-triggers, check for alloc failure and zone for add rpz soa.
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Fri, 14 May 2021 15:27:15 +0000 (17:27 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Fri, 14 May 2021 15:27:15 +0000 (17:27 +0200)
services/rpz.c

index a389cf101decad99dbc6c9ef44ef83c5d0bc6ac1..eb49f1cb3d5bf119bb3ee83a35391ebf3e9c34fa 100644 (file)
@@ -1637,6 +1637,7 @@ rpz_add_soa(struct reply_info* rep, struct module_qstate* ms,
        struct auth_rrset* soa = NULL;
        struct ub_packed_rrset_key* rsoa = NULL;
        struct ub_packed_rrset_key** prevrrsets;
+       if(!az) return 1;
        soa = auth_zone_get_soa_rrset(az);
        if(!soa) return 1;
        if(!rep) return 0;
@@ -1645,6 +1646,8 @@ rpz_add_soa(struct reply_info* rep, struct module_qstate* ms,
        prevrrsets = rep->rrsets;
        rep->rrsets = regional_alloc_zero(ms->region,
                sizeof(*rep->rrsets)*(rep->rrset_count+1));
+       if(!rep->rrsets)
+               return 0;
        if(prevrrsets && rep->rrset_count > 0)
                memcpy(rep->rrsets, prevrrsets, rep->rrset_count*sizeof(*rep->rrsets));
        rep->rrset_count++;