mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-09 11:18:52 +00:00
lib: don't abort when incomplete xpath is given by the user
Instead of aborting when an incomplete xpath is given to the nb_oper_data_iterate() function, just return an error so that the callers have a chance to treat this error. Aborting based on invalid user input is never the right thing to do. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
This commit is contained in:
parent
f65fb6b4b4
commit
9f6de29901
@ -1278,8 +1278,12 @@ int nb_oper_data_iterate(const char *xpath, struct yang_translator *translator,
|
|||||||
n++;
|
n++;
|
||||||
}
|
}
|
||||||
list_keys.num = n;
|
list_keys.num = n;
|
||||||
assert(list_keys.num
|
if (list_keys.num
|
||||||
== ((struct lys_node_list *)dn->schema)->keys_size);
|
!= ((struct lys_node_list *)dn->schema)->keys_size) {
|
||||||
|
list_delete(&list_dnodes);
|
||||||
|
yang_dnode_free(dnode);
|
||||||
|
return NB_ERR_NOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
/* Find the list entry pointer. */
|
/* Find the list entry pointer. */
|
||||||
nn = dn->schema->priv;
|
nn = dn->schema->priv;
|
||||||
|
Loading…
Reference in New Issue
Block a user