Skip to content

Commit

Permalink
schema compile UPDATE skip xpath checks on disabled nodes
Browse files Browse the repository at this point in the history
High risk of false-positives.
Fixes CESNET#2251
  • Loading branch information
michalvasko committed Jun 12, 2024
1 parent 6cc25d4 commit 3139a58
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/schema_compile_node.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ lysc_unres_when_add(struct lysc_ctx *ctx, struct lysc_when *when, struct lysc_no
LY_ERR rc = LY_SUCCESS;
struct lysc_unres_when *w = NULL;

/* do not check must(s) in a grouping */
if (ctx->compile_opts & LYS_COMPILE_GROUPING) {
/* do not check when(s) in a grouping or in disabled data (high risk of false-positives) */
if (ctx->compile_opts & (LYS_COMPILE_GROUPING | LYS_COMPILE_DISABLED)) {
goto cleanup;
}

Expand Down Expand Up @@ -103,8 +103,8 @@ lysc_unres_must_add(struct lysc_ctx *ctx, struct lysc_node *node, struct lysp_no
struct lysp_restr *pmusts;
LY_ERR ret;

/* do not check must(s) in a grouping */
if (ctx->compile_opts & LYS_COMPILE_GROUPING) {
/* do not check must(s) in a grouping or in disabled data (high risk of false-positives) */
if (ctx->compile_opts & (LYS_COMPILE_GROUPING | LYS_COMPILE_DISABLED)) {
return LY_SUCCESS;
}

Expand Down

0 comments on commit 3139a58

Please sign in to comment.