diff options
Diffstat (limited to '')
-rw-r--r-- | epan/dissectors/packet-glow.c | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/epan/dissectors/packet-glow.c b/epan/dissectors/packet-glow.c index 32e6ec9d..d374395c 100644 --- a/epan/dissectors/packet-glow.c +++ b/epan/dissectors/packet-glow.c @@ -185,7 +185,6 @@ static int dissect_glow_ElementCollection(bool implicit_tag _U_, tvbuff_t *tvb _ static int dissect_glow_Template(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_); -#define MAX_RECURSION_DEPTH 100 // Arbitrarily chosen. static int @@ -1086,15 +1085,14 @@ dissect_glow_SEQUENCE_OF_Element(bool implicit_tag _U_, tvbuff_t *tvb _U_, int o static int dissect_glow_ElementCollection(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { - const int proto_id = GPOINTER_TO_INT(wmem_list_frame_data(wmem_list_tail(actx->pinfo->layers))); - const unsigned cycle_size = 6; - unsigned recursion_depth = p_get_proto_depth(actx->pinfo, proto_id); - DISSECTOR_ASSERT(recursion_depth <= MAX_RECURSION_DEPTH); - p_set_proto_depth(actx->pinfo, proto_id, recursion_depth + cycle_size); + // ElementCollection → ElementCollection/_untag → Element → Node → Node/_untag → ElementCollection + actx->pinfo->dissection_depth += 5; + increment_dissection_depth(actx->pinfo); offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset, hf_index, BER_CLASS_APP, 4, TRUE, dissect_glow_SEQUENCE_OF_Element); - p_set_proto_depth(actx->pinfo, proto_id, recursion_depth - cycle_size); + actx->pinfo->dissection_depth -= 5; + decrement_dissection_depth(actx->pinfo); return offset; } @@ -1118,15 +1116,14 @@ dissect_glow_Parameter_U(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U static int dissect_glow_Parameter(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { - const int proto_id = GPOINTER_TO_INT(wmem_list_frame_data(wmem_list_tail(actx->pinfo->layers))); - const unsigned cycle_size = 6; - unsigned recursion_depth = p_get_proto_depth(actx->pinfo, proto_id); - DISSECTOR_ASSERT(recursion_depth <= MAX_RECURSION_DEPTH); - p_set_proto_depth(actx->pinfo, proto_id, recursion_depth + cycle_size); + // Parameter → Parameter/_untag → ElementCollection → ElementCollection/_untag → Element → Parameter + actx->pinfo->dissection_depth += 5; + increment_dissection_depth(actx->pinfo); offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset, hf_index, BER_CLASS_APP, 1, TRUE, dissect_glow_Parameter_U); - p_set_proto_depth(actx->pinfo, proto_id, recursion_depth - cycle_size); + actx->pinfo->dissection_depth -= 5; + decrement_dissection_depth(actx->pinfo); return offset; } @@ -1176,15 +1173,14 @@ dissect_glow_Template_U(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_ static int dissect_glow_Template(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { - const int proto_id = GPOINTER_TO_INT(wmem_list_frame_data(wmem_list_tail(actx->pinfo->layers))); - const unsigned cycle_size = 9; - unsigned recursion_depth = p_get_proto_depth(actx->pinfo, proto_id); - DISSECTOR_ASSERT(recursion_depth <= MAX_RECURSION_DEPTH); - p_set_proto_depth(actx->pinfo, proto_id, recursion_depth + cycle_size); + // Template → Template/_untag → TemplateElement → Parameter → Parameter/_untag → ElementCollection → ElementCollection/_untag → Element → Template + actx->pinfo->dissection_depth += 8; + increment_dissection_depth(actx->pinfo); offset = dissect_ber_tagged_type(implicit_tag, actx, tree, tvb, offset, hf_index, BER_CLASS_APP, 24, TRUE, dissect_glow_Template_U); - p_set_proto_depth(actx->pinfo, proto_id, recursion_depth - cycle_size); + actx->pinfo->dissection_depth -= 8; + decrement_dissection_depth(actx->pinfo); return offset; } |