Skip to content

Commit

Permalink
Fix crash with queries to proxy-node schemas
Browse files Browse the repository at this point in the history
Querying the fields of a model with a proxy node, with the option of
report-all causes a crash in apteryx-xml/schema.c in the function
_sch_traverse_nodes. This is due to schema being set to NULL while
handling the proxy node. This change exits the routine early if schema
is set to NULL.
  • Loading branch information
gcampbell512 authored and carlgsmith committed Aug 27, 2024
1 parent 09ed81e commit 6cf2223
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions schema.c
Original file line number Diff line number Diff line change
Expand Up @@ -3149,6 +3149,12 @@ _sch_traverse_nodes (sch_instance * instance, sch_node * schema, GNode * parent,
g_free (name);
name = sch_name (schema);
}
else
{
/* This can happen if a query is for a field of the proxy schema itself */
rc = false;
goto exit;
}
depth++;
}

Expand Down

0 comments on commit 6cf2223

Please sign in to comment.