From: W.C.A. Wijngaards Date: Fri, 4 Apr 2025 06:57:24 +0000 (+0200) Subject: - Fix mesh_copy_client_info to omit null contents from copy. X-Git-Tag: release-1.23.0rc1~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7fb05c01c2ed5ff36e36a1d7e6693701a8161e7b;p=thirdparty%2Funbound.git - Fix mesh_copy_client_info to omit null contents from copy. --- diff --git a/doc/Changelog b/doc/Changelog index 9c820e455..9e833b87a 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -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 diff --git a/services/mesh.c b/services/mesh.c index e41f1c92b..b62aa5c17 100644 --- a/services/mesh.c +++ b/services/mesh.c @@ -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; itag_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; itag_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) {