From 035851a0a3a66be53279b66f493f081677222e9c Mon Sep 17 00:00:00 2001 From: optimden Date: Wed, 14 Feb 2024 14:37:57 +0545 Subject: [PATCH] instanceid BUGFIX redunant check causing wrong comparison (#2173) * removed unnecessary check, that s1->predicates not equals to NULL. It's possible due LY_ARRAY_COUNT can handles NULL pointer by itself. * before this fix comparison old value without predicate and a new one with predicate returned LY_SUCCES instead of LY_ENOT --- src/plugins_types/instanceid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins_types/instanceid.c b/src/plugins_types/instanceid.c index c15ff64a3..e2d01e397 100644 --- a/src/plugins_types/instanceid.c +++ b/src/plugins_types/instanceid.c @@ -267,7 +267,7 @@ lyplg_type_compare_instanceid(const struct lyd_value *val1, const struct lyd_val struct ly_path *s1 = &val1->target[u]; struct ly_path *s2 = &val2->target[u]; - if ((s1->node != s2->node) || (s1->predicates && (LY_ARRAY_COUNT(s1->predicates) != LY_ARRAY_COUNT(s2->predicates)))) { + if ((s1->node != s2->node) || (LY_ARRAY_COUNT(s1->predicates) != LY_ARRAY_COUNT(s2->predicates))) { return LY_ENOT; } LY_ARRAY_FOR(s1->predicates, v) {