Skip to content

Commit

Permalink
printer_tree: avoid NULL pointer dereference in trp_ext_is_present()
Browse files Browse the repository at this point in the history
  • Loading branch information
hugeping committed Aug 6, 2023
1 parent ea94c8b commit 369c66e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/printer_tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -1873,7 +1873,7 @@ trp_ext_is_present(ly_bool lysc_tree, const void *node)
} else {
pn = (const struct lysp_node *)node;
LY_ARRAY_FOR(pn->exts, i) {
if (!(pn->exts && pn->exts->record->plugin.printer_ptree)) {
if (!(pn->exts && pn->exts->record && pn->exts->record->plugin.printer_ptree)) {
continue;
}
if (!trp_ext_parent_is_valid(0, &pn->exts[i])) {
Expand Down

0 comments on commit 369c66e

Please sign in to comment.