diff options
Diffstat (limited to 'epan/dissectors/file-rbm.c')
-rw-r--r-- | epan/dissectors/file-rbm.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/epan/dissectors/file-rbm.c b/epan/dissectors/file-rbm.c index 988b7048..dd043d35 100644 --- a/epan/dissectors/file-rbm.c +++ b/epan/dissectors/file-rbm.c @@ -20,8 +20,10 @@ */ #include "config.h" -#include <epan/packet.h> + #include <epan/expert.h> +#include <epan/packet.h> + #include <file-rbm.h> #include <wiretap/ruby_marshal.h> @@ -193,6 +195,7 @@ static void dissect_rbm_string_data(tvbuff_t* tvb, packet_info* pinfo, proto_tre dissect_rbm_string_data_trailer(tvb, pinfo, tree, offset, label, prefix, "", value_str); } +// NOLINTNEXTLINE(misc-no-recursion) static void dissect_rbm_array(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, guint* offset, gchar** value_str) { gint32 value; @@ -219,6 +222,7 @@ static void dissect_rbm_array(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tre *value_str = wmem_strdup_printf(pinfo->pool, "%d", value); } +// NOLINTNEXTLINE(misc-no-recursion) static void dissect_rbm_hash(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, guint* offset, gchar** value_str) { gint32 value; @@ -318,6 +322,7 @@ static void dissect_rbm_struct_data(tvbuff_t* tvb, packet_info* pinfo, proto_tre *value_str = wmem_strdup_printf(pinfo->pool, "%d", value); } +// NOLINTNEXTLINE(misc-no-recursion) static void dissect_rbm_string(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, guint* offset, gchar** value) { dissect_rbm_string_data(tvb, pinfo, tree, offset, "String", "", value); @@ -326,6 +331,7 @@ static void dissect_rbm_string(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tr dissect_rbm_object(tvb, pinfo, tree, offset, NULL, NULL); } +// NOLINTNEXTLINE(misc-no-recursion) static void dissect_rbm_regex(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, guint* offset, gchar** value) { dissect_rbm_string_data_trailer(tvb, pinfo, tree, offset, "Regexp", "/", "/", value); @@ -341,6 +347,7 @@ static void dissect_rbm_class(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tre dissect_rbm_string_data(tvb, pinfo, tree, offset, "Class", "", value_str); } +// NOLINTNEXTLINE(misc-no-recursion) static void dissect_rbm_userclass(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, guint* offset, gchar** value) { rbm_set_info(pinfo, "UserClass"); @@ -352,6 +359,7 @@ static void dissect_rbm_symbol(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tr dissect_rbm_string_data(tvb, pinfo, tree, offset, "Symbol", ":", value_str); } +// NOLINTNEXTLINE(misc-no-recursion) static void dissect_rbm_variable(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, guint* offset, gchar** value_str) { gint offset_start = *offset; @@ -365,12 +373,14 @@ static void dissect_rbm_module(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tr dissect_rbm_string_data(tvb, pinfo, tree, offset, "Module", "", value_str); } +// NOLINTNEXTLINE(misc-no-recursion) static void dissect_rbm_struct(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, guint* offset, gchar** value) { dissect_rbm_struct_data(tvb, pinfo, tree, offset, value); dissect_rbm_hash(tvb, pinfo, tree, offset, NULL); } +// NOLINTNEXTLINE(misc-no-recursion) static void dissect_rbm_drb(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, guint* offset) { gint offset_start = *offset; @@ -380,6 +390,7 @@ static void dissect_rbm_drb(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, proto_item_set_len(drb_tree, *offset - offset_start); } +// NOLINTNEXTLINE(misc-no-recursion) static void dissect_rbm_rubyobject(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, guint* offset) { gint offset_start = *offset; @@ -397,6 +408,7 @@ static void dissect_rbm_rubyobject(tvbuff_t* tvb, packet_info* pinfo, proto_tree proto_item_set_len(obj_tree, *offset - offset_start); } +// NOLINTNEXTLINE(misc-no-recursion) static void dissect_rbm_extended(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, guint* offset) { gint offset_start = *offset; @@ -407,6 +419,7 @@ static void dissect_rbm_extended(tvbuff_t* tvb, packet_info* pinfo, proto_tree* proto_item_set_len(ext_tree, *offset - offset_start); } +// NOLINTNEXTLINE(misc-no-recursion) static void dissect_rbm_object(tvbuff_t* tvb, packet_info* pinfo, proto_tree* ptree, guint* offset, gchar** type, gchar** value) { guint8 subtype = tvb_get_guint8(tvb, *offset); @@ -420,6 +433,8 @@ static void dissect_rbm_object(tvbuff_t* tvb, packet_info* pinfo, proto_tree* pt proto_tree_add_item(tree, hf_rbm_type, tvb, *offset, 1, ENC_NA); *offset += 1; + increment_dissection_depth(pinfo); + switch (subtype) { case '0': case 'T': @@ -509,6 +524,8 @@ static void dissect_rbm_object(tvbuff_t* tvb, packet_info* pinfo, proto_tree* pt *type = type_local; if (value) *value = value_local; + + decrement_dissection_depth(pinfo); } static gboolean dissect_rbm_header(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, guint* offset) @@ -532,6 +549,7 @@ static gboolean dissect_rbm_header(tvbuff_t* tvb, packet_info* pinfo, proto_tree return TRUE; } +// NOLINTNEXTLINE(misc-no-recursion) void dissect_rbm_inline(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, guint* offset, gchar** type, gchar** value) { if (!dissect_rbm_header(tvb, pinfo, tree, offset)) |