Skip to content

Commit

Permalink
Set correct depth on cloned child attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
ndptech committed Sep 20, 2024
1 parent e1120d7 commit 10a612c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib/util/dict_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,7 @@ int dict_attr_acopy_children(fr_dict_t *dict, fr_dict_attr_t *dst, fr_dict_attr_
fr_dict_attr_t const *child = NULL;
fr_dict_attr_t *copy;
fr_dict_attr_ext_enumv_t *ext;
uint depth_diff = dst->depth - src->depth;

fr_assert(fr_dict_attr_has_ext(dst, FR_DICT_ATTR_EXT_CHILDREN));
fr_assert(dst->type == src->type);
Expand All @@ -818,6 +819,7 @@ int dict_attr_acopy_children(fr_dict_t *dict, fr_dict_attr_t *dst, fr_dict_attr_
}

copy->parent = dst;
copy->depth += depth_diff;

if (dict_attr_child_add(dst, copy) < 0) return -1;

Expand Down

0 comments on commit 10a612c

Please sign in to comment.