summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-xml.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--epan/dissectors/packet-xml.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/epan/dissectors/packet-xml.c b/epan/dissectors/packet-xml.c
index a2edca83..e7a7a960 100644
--- a/epan/dissectors/packet-xml.c
+++ b/epan/dissectors/packet-xml.c
@@ -1119,6 +1119,7 @@ static gchar *fully_qualified_name(GPtrArray *hier, gchar *name, gchar *proto_na
}
+// NOLINTNEXTLINE(misc-no-recursion)
static xml_ns_t *make_xml_hier(gchar *elem_name,
xml_ns_t *root,
wmem_map_t *elements,
@@ -1145,6 +1146,11 @@ static xml_ns_t *make_xml_hier(gchar *elem_name,
return NULL;
}
+ if (hier->len >= prefs.gui_max_tree_depth) {
+ g_string_append_printf(error, "hierarchy too deep: %u\n", hier->len);
+ return NULL;
+ }
+
for (i = 0; i < hier->len; i++) {
if( (elem_name) && (strcmp(elem_name, (gchar *) g_ptr_array_index(hier, i) ) == 0 )) {
recurred = TRUE;