Skip to content

Commit 60b02ff

Browse files
committed
lyb BUGFIX actually check that required models are in the context
1 parent fbf5fd6 commit 60b02ff

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/parser_lyb.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,16 @@ lyb_parse_model(struct ly_ctx *ctx, const char *data, const struct lys_module **
242242
}
243243
}
244244

245+
if (!*mod) {
246+
LOGERR(ctx, LY_EINVAL, "Invalid context for LYB data parsing, missing module \"%s%s%s\".",
247+
mod_name, rev ? "@" : "", rev ? mod_rev : "");
248+
goto error;
249+
} else if (!(*mod)->implemented) {
250+
LOGERR(ctx, LY_EINVAL, "Invalid context for LYB data parsing, module \"%s%s%s\" not implemented.",
251+
mod_name, rev ? "@" : "", rev ? mod_rev : "");
252+
goto error;
253+
}
254+
245255
free(mod_name);
246256
return ret;
247257

0 commit comments

Comments
 (0)