diff options
Diffstat (limited to '')
-rw-r--r-- | epan/dissectors/packet-x509if.c | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/epan/dissectors/packet-x509if.c b/epan/dissectors/packet-x509if.c index 31cf56d..25bed90 100644 --- a/epan/dissectors/packet-x509if.c +++ b/epan/dissectors/packet-x509if.c @@ -316,7 +316,6 @@ x509if_frame_end(void) /*int dissect_x509if_AttributeCombination(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 @@ -1048,16 +1047,15 @@ static const ber_choice_t Refinement_choice[] = { int dissect_x509if_Refinement(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 = 3; - 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); + // Refinement → Refinement/and → Refinement + actx->pinfo->dissection_depth += 2; + increment_dissection_depth(actx->pinfo); offset = dissect_ber_choice(actx, tree, tvb, offset, Refinement_choice, hf_index, ett_x509if_Refinement, NULL); - p_set_proto_depth(actx->pinfo, proto_id, recursion_depth - cycle_size); + actx->pinfo->dissection_depth -= 2; + decrement_dissection_depth(actx->pinfo); return offset; } @@ -1493,16 +1491,15 @@ static const ber_choice_t ContextCombination_choice[] = { int dissect_x509if_ContextCombination(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 = 3; - 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); + // ContextCombination → ContextCombination/and → ContextCombination + actx->pinfo->dissection_depth += 2; + increment_dissection_depth(actx->pinfo); offset = dissect_ber_choice(actx, tree, tvb, offset, ContextCombination_choice, hf_index, ett_x509if_ContextCombination, NULL); - p_set_proto_depth(actx->pinfo, proto_id, recursion_depth - cycle_size); + actx->pinfo->dissection_depth -= 2; + decrement_dissection_depth(actx->pinfo); return offset; } @@ -1618,16 +1615,15 @@ static const ber_choice_t AttributeCombination_choice[] = { int dissect_x509if_AttributeCombination(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 = 3; - 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); + // AttributeCombination → AttributeCombination/and → AttributeCombination + actx->pinfo->dissection_depth += 2; + increment_dissection_depth(actx->pinfo); offset = dissect_ber_choice(actx, tree, tvb, offset, AttributeCombination_choice, hf_index, ett_x509if_AttributeCombination, NULL); - p_set_proto_depth(actx->pinfo, proto_id, recursion_depth - cycle_size); + actx->pinfo->dissection_depth -= 2; + decrement_dissection_depth(actx->pinfo); return offset; } |