]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix to check for malloc failure in rpz response create,
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 17 Jun 2026 13:59:29 +0000 (15:59 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 17 Jun 2026 13:59:29 +0000 (15:59 +0200)
  for nodata and nxdomain, so it does not crash later.
  Thanks to Qifan Zhang, Palo Alto Networks, for the report.

doc/Changelog
services/rpz.c

index afa7c5ccb102f43c878139d52748f2a7d8a42251..a5351e39de9cc0efe40a79020b4003acec523ff4 100644 (file)
@@ -45,6 +45,9 @@
        - Fix to check the return value of auth_xfer_create
          during fast_reload auth-zone add and change processing.
          Thanks to Qifan Zhang, Palo Alto Networks, for the report.
+       - Fix to check for malloc failure in rpz response create,
+         for nodata and nxdomain, so it does not crash later.
+         Thanks to Qifan Zhang, Palo Alto Networks, for the report.
 
 16 June 2026: Wouter
        - Fix to disallow $INCLUDE for secondary zones. Start up
index d0895746d4f020530e0e26fc8badcacbeca8a74c..1a23e52a0ae791a105712081899ab174ecc087d9 100644 (file)
@@ -1991,8 +1991,9 @@ rpz_synthesize_nodata(struct rpz* ATTR_UNUSED(r), struct module_qstate* ms,
                                             0, /* total */
                                             sec_status_insecure,
                                             LDNS_EDE_NONE);
-       if(msg->rep)
-               msg->rep->authoritative = 1;
+       if(!msg->rep)
+               return NULL;
+       msg->rep->authoritative = 1;
        if(!rpz_add_soa(msg->rep, ms, az))
                return NULL;
        return msg;
@@ -2022,8 +2023,9 @@ rpz_synthesize_nxdomain(struct rpz* r, struct module_qstate* ms,
                                             0, /* total */
                                             sec_status_insecure,
                                             LDNS_EDE_NONE);
-       if(msg->rep)
-               msg->rep->authoritative = 1;
+       if(!msg->rep)
+               return NULL;
+       msg->rep->authoritative = 1;
        if(!rpz_add_soa(msg->rep, ms, az))
                return NULL;
        return msg;