diff options
Diffstat (limited to 'epan/dissectors/packet-h225.c')
-rw-r--r-- | epan/dissectors/packet-h225.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/epan/dissectors/packet-h225.c b/epan/dissectors/packet-h225.c index 5bd5f1f1..1d348ad1 100644 --- a/epan/dissectors/packet-h225.c +++ b/epan/dissectors/packet-h225.c @@ -1257,7 +1257,6 @@ static int dissect_h225_EnumeratedParameter(tvbuff_t *tvb _U_, int offset _U_, a /*int dissect_h225_GenericData(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 @@ -3968,11 +3967,9 @@ static const per_sequence_t EnumeratedParameter_sequence[] = { static int dissect_h225_EnumeratedParameter(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 = 4; - 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); + // EnumeratedParameter → Content → Content/compound → EnumeratedParameter + actx->pinfo->dissection_depth += 3; + increment_dissection_depth(actx->pinfo); gef_ctx_t *parent_gefx; parent_gefx = gef_ctx_get(actx->private_data); @@ -3980,7 +3977,8 @@ dissect_h225_EnumeratedParameter(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t * offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_h225_EnumeratedParameter, EnumeratedParameter_sequence); - p_set_proto_depth(actx->pinfo, proto_id, recursion_depth - cycle_size); + actx->pinfo->dissection_depth -= 3; + decrement_dissection_depth(actx->pinfo); actx->private_data = parent_gefx; return offset; } @@ -3994,11 +3992,9 @@ static const per_sequence_t GenericData_sequence[] = { int dissect_h225_GenericData(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); + // GenericData → GenericData/parameters → EnumeratedParameter → Content → Content/nested → GenericData + actx->pinfo->dissection_depth += 5; + increment_dissection_depth(actx->pinfo); void *priv_data = actx->private_data; gef_ctx_t *gefx; @@ -4011,7 +4007,8 @@ dissect_h225_GenericData(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_ offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, ett_h225_GenericData, GenericData_sequence); - p_set_proto_depth(actx->pinfo, proto_id, recursion_depth - cycle_size); + actx->pinfo->dissection_depth -= 5; + decrement_dissection_depth(actx->pinfo); actx->private_data = priv_data; return offset; } |