Skip to content

Commit b033b1c

Browse files
committed
plugins exts BUGFIX prevent NULL dereference
1 parent 5d81a94 commit b033b1c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/plugins_exts.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -751,14 +751,14 @@ lyplg_ext_set_parent_ctx(struct ly_ctx *ctx, const struct ly_ctx *parent_ctx)
751751

752752
/* prevent circular reference chain */
753753
c = parent_ctx;
754-
do {
754+
while (c) {
755755
if (c->parent_ctx == ctx) {
756756
LOGERR(ctx, LY_EDENIED, "Circular references of parent contexts.");
757757
return LY_EDENIED;
758758
}
759759

760760
c = c->parent_ctx;
761-
} while (c);
761+
}
762762

763763
if (!ctx->parent_ctx) {
764764
if (ly_ctx_is_printed(ctx) && ly_ctx_is_printed(parent_ctx)) {

0 commit comments

Comments
 (0)