Skip to content

Commit 8ad1dd0

Browse files
committed
validation BUGFIX properly handle a corner case
1 parent 18c562e commit 8ad1dd0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/validation.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2484,6 +2484,10 @@ lyd_validate_op(struct lyd_node *op_tree, const struct lyd_node *dep_tree, enum
24842484

24852485
LY_CHECK_ARG_RET(NULL, op_tree, !dep_tree || !dep_tree->parent, (data_type == LYD_TYPE_RPC_YANG) ||
24862486
(data_type == LYD_TYPE_NOTIF_YANG) || (data_type == LYD_TYPE_REPLY_YANG), LY_EINVAL);
2487+
if (op_tree == dep_tree) {
2488+
/* redundant dependency */
2489+
dep_tree = NULL;
2490+
}
24872491
if (diff) {
24882492
*diff = NULL;
24892493
}

0 commit comments

Comments
 (0)