Skip to content

Commit

Permalink
tree_data BUGFIX check plugin existence (#2175)
Browse files Browse the repository at this point in the history
This patch fixes segfault issue, when no plugin is set
  • Loading branch information
steweg authored Feb 16, 2024
1 parent 03d6d6c commit a9756fc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/tree_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,7 @@ lyd_create_meta(struct lyd_node *parent, struct lyd_meta **meta, const struct ly
assert((parent || meta) && mod);

LY_ARRAY_FOR(mod->compiled->exts, u) {
if (!strncmp(mod->compiled->exts[u].def->plugin->id, "ly2 metadata", 12) &&
if (mod->compiled->exts[u].def->plugin && !strncmp(mod->compiled->exts[u].def->plugin->id, "ly2 metadata", 12) &&
!ly_strncmp(mod->compiled->exts[u].argument, name, name_len)) {
/* we have the annotation definition */
ant = &mod->compiled->exts[u];
Expand Down

0 comments on commit a9756fc

Please sign in to comment.