]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix mesh_copy_client_info to omit null contents from copy.
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Fri, 4 Apr 2025 06:57:24 +0000 (08:57 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Fri, 4 Apr 2025 06:57:24 +0000 (08:57 +0200)
doc/Changelog
services/mesh.c

index 9c820e45523f7d44b727748e0f2021f03831dbd0..9e833b87a59776dc1e5e9b73e52ad797d025f5a9 100644 (file)
@@ -1,3 +1,6 @@
+4 April 2025: Wouter
+       - Fix mesh_copy_client_info to omit null contents from copy.
+
 3 April 2025: Wouter
        - Fix #1263: Exempt loopback addresses from wait-limit.
        - Fix wait-limit-netblock and wait-limit-cookie-netblock config parse
index e41f1c92b6b84412dc058827f523ef43d879e6d4..b62aa5c17c59a85ad2ec98036fa20be65ec720ea 100644 (file)
@@ -919,24 +919,30 @@ mesh_copy_client_info(struct regional* region, struct respip_client_info* cinfo)
                return NULL;
        /* Copy the client_info so that if the configuration changes,
         * then the data stays valid. */
-       client_info->taglist = regional_alloc_init(region, cinfo->taglist,
-               cinfo->taglen);
-       if(!client_info->taglist)
-               return NULL;
-       client_info->tag_actions = regional_alloc_init(region, cinfo->tag_actions,
-               cinfo->tag_actions_size);
-       if(!client_info->tag_actions)
-               return NULL;
-       client_info->tag_datas = regional_alloc_zero(region,
-               sizeof(struct config_strlist*)*cinfo->tag_datas_size);
-       if(!client_info->tag_datas)
-               return NULL;
-       for(i=0; i<cinfo->tag_datas_size; i++) {
-               if(cinfo->tag_datas[i]) {
-                       client_info->tag_datas[i] = cfg_region_strlist_copy(
-                               region, cinfo->tag_datas[i]);
-                       if(!client_info->tag_datas[i])
-                               return NULL;
+       if(cinfo->taglist) {
+               client_info->taglist = regional_alloc_init(region, cinfo->taglist,
+                       cinfo->taglen);
+               if(!client_info->taglist)
+                       return NULL;
+       }
+       if(cinfo->tag_actions) {
+               client_info->tag_actions = regional_alloc_init(region, cinfo->tag_actions,
+                       cinfo->tag_actions_size);
+               if(!client_info->tag_actions)
+                       return NULL;
+       }
+       if(cinfo->tag_datas) {
+               client_info->tag_datas = regional_alloc_zero(region,
+                       sizeof(struct config_strlist*)*cinfo->tag_datas_size);
+               if(!client_info->tag_datas)
+                       return NULL;
+               for(i=0; i<cinfo->tag_datas_size; i++) {
+                       if(cinfo->tag_datas[i]) {
+                               client_info->tag_datas[i] = cfg_region_strlist_copy(
+                                       region, cinfo->tag_datas[i]);
+                               if(!client_info->tag_datas[i])
+                                       return NULL;
+                       }
                }
        }
        if(cinfo->view) {