Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreadman committed Jan 9, 2024
2 parents d2e2c02 + 66c607f commit 9e19346
Show file tree
Hide file tree
Showing 30 changed files with 337 additions and 172 deletions.
13 changes: 7 additions & 6 deletions epan/crypt/dot11decrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1106,13 +1106,14 @@ Dot11DecryptCleanKeys(
}

static void
Dot11DecryptRecurseCleanSA(
Dot11DecryptCleanSA(
void * first_sa)
{
DOT11DECRYPT_SEC_ASSOCIATION *sa = (DOT11DECRYPT_SEC_ASSOCIATION *)first_sa;
if (sa != NULL) {
Dot11DecryptRecurseCleanSA((void *)sa->next);
g_free(sa);
DOT11DECRYPT_SEC_ASSOCIATION *cur_sa = (DOT11DECRYPT_SEC_ASSOCIATION *)first_sa;
while (cur_sa) {
DOT11DECRYPT_SEC_ASSOCIATION *next_sa = cur_sa->next;
g_free(cur_sa);
cur_sa = next_sa;
}
}

Expand Down Expand Up @@ -1174,7 +1175,7 @@ int Dot11DecryptInitContext(

ctx->pkt_ssid_len = 0;
ctx->sa_hash = g_hash_table_new_full(Dot11DecryptSaHash, Dot11DecryptIsSaIdEqual,
g_free, Dot11DecryptRecurseCleanSA);
g_free, Dot11DecryptCleanSA);
if (ctx->sa_hash == NULL) {
return DOT11DECRYPT_RET_UNSUCCESS;
}
Expand Down
4 changes: 3 additions & 1 deletion epan/dissectors/packet-cmip.c
Original file line number Diff line number Diff line change
Expand Up @@ -1015,13 +1015,15 @@ dissect_cmip_CMISFilter(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _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);

offset = dissect_ber_choice(actx, tree, tvb, offset,
CMISFilter_choice, hf_index, ett_cmip_CMISFilter,
NULL);

p_set_proto_depth(actx->pinfo, proto_id, recursion_depth - cycle_size);
p_set_proto_depth(actx->pinfo, proto_id, recursion_depth);
return offset;
}

Expand Down
4 changes: 3 additions & 1 deletion epan/dissectors/packet-cmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1091,12 +1091,14 @@ dissect_cmp_PKIMessage(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_,
const int proto_id = GPOINTER_TO_INT(wmem_list_frame_data(wmem_list_tail(actx->pinfo->layers)));
const unsigned cycle_size = 5;
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);

offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
PKIMessage_sequence, hf_index, ett_cmp_PKIMessage);

p_set_proto_depth(actx->pinfo, proto_id, recursion_depth - cycle_size);
p_set_proto_depth(actx->pinfo, proto_id, recursion_depth);
return offset;
}

Expand Down
16 changes: 12 additions & 4 deletions epan/dissectors/packet-dap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1269,12 +1269,14 @@ dissect_dap_FamilyEntries(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _
const int proto_id = GPOINTER_TO_INT(wmem_list_frame_data(wmem_list_tail(actx->pinfo->layers)));
const unsigned cycle_size = 5;
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);

offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
FamilyEntries_sequence, hf_index, ett_dap_FamilyEntries);

p_set_proto_depth(actx->pinfo, proto_id, recursion_depth - cycle_size);
p_set_proto_depth(actx->pinfo, proto_id, recursion_depth);
return offset;
}

Expand Down Expand Up @@ -1473,13 +1475,15 @@ dissect_dap_Filter(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn
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);

offset = dissect_ber_choice(actx, tree, tvb, offset,
Filter_choice, hf_index, ett_dap_Filter,
NULL);

p_set_proto_depth(actx->pinfo, proto_id, recursion_depth - cycle_size);
p_set_proto_depth(actx->pinfo, proto_id, recursion_depth);
return offset;
}

Expand Down Expand Up @@ -2935,13 +2939,15 @@ dissect_dap_ListResultData(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset
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);

offset = dissect_ber_choice(actx, tree, tvb, offset,
ListResultData_choice, hf_index, ett_dap_ListResultData,
NULL);

p_set_proto_depth(actx->pinfo, proto_id, recursion_depth - cycle_size);
p_set_proto_depth(actx->pinfo, proto_id, recursion_depth);
return offset;
}

Expand Down Expand Up @@ -3326,13 +3332,15 @@ dissect_dap_SearchResultData(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offse
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);

offset = dissect_ber_choice(actx, tree, tvb, offset,
SearchResultData_choice, hf_index, ett_dap_SearchResultData,
NULL);

p_set_proto_depth(actx->pinfo, proto_id, recursion_depth - cycle_size);
p_set_proto_depth(actx->pinfo, proto_id, recursion_depth);
return offset;
}

Expand Down
8 changes: 6 additions & 2 deletions epan/dissectors/packet-disp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1045,12 +1045,14 @@ dissect_disp_Subtree(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, a
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);

offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
Subtree_sequence, hf_index, ett_disp_Subtree);

p_set_proto_depth(actx->pinfo, proto_id, recursion_depth - cycle_size);
p_set_proto_depth(actx->pinfo, proto_id, recursion_depth);
return offset;
}

Expand Down Expand Up @@ -1209,12 +1211,14 @@ dissect_disp_IncrementalStepRefresh(bool implicit_tag _U_, tvbuff_t *tvb _U_, in
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);

offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset,
IncrementalStepRefresh_sequence, hf_index, ett_disp_IncrementalStepRefresh);

p_set_proto_depth(actx->pinfo, proto_id, recursion_depth - cycle_size);
p_set_proto_depth(actx->pinfo, proto_id, recursion_depth);
return offset;
}

Expand Down
12 changes: 9 additions & 3 deletions epan/dissectors/packet-e2ap.c
Original file line number Diff line number Diff line change
Expand Up @@ -7428,12 +7428,14 @@ dissect_e2ap_RANParameter_Testing_Item(tvbuff_t *tvb _U_, int offset _U_, asn1_c
const int proto_id = GPOINTER_TO_INT(wmem_list_frame_data(wmem_list_tail(actx->pinfo->layers)));
const unsigned cycle_size = 5;
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);

offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
ett_e2ap_RANParameter_Testing_Item, RANParameter_Testing_Item_sequence);

p_set_proto_depth(actx->pinfo, proto_id, recursion_depth - cycle_size);
p_set_proto_depth(actx->pinfo, proto_id, recursion_depth);
return offset;
}

Expand Down Expand Up @@ -7821,12 +7823,14 @@ dissect_e2ap_RANParameter_Definition(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx
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);

offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
ett_e2ap_RANParameter_Definition, RANParameter_Definition_sequence);

p_set_proto_depth(actx->pinfo, proto_id, recursion_depth - cycle_size);
p_set_proto_depth(actx->pinfo, proto_id, recursion_depth);
return offset;
}

Expand Down Expand Up @@ -7979,13 +7983,15 @@ dissect_e2ap_RANParameter_ValueType(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_
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);

offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
ett_e2ap_RANParameter_ValueType, RANParameter_ValueType_choice,
NULL);

p_set_proto_depth(actx->pinfo, proto_id, recursion_depth - cycle_size);
p_set_proto_depth(actx->pinfo, proto_id, recursion_depth);
return offset;
}

Expand Down
12 changes: 9 additions & 3 deletions epan/dissectors/packet-glow.c
Original file line number Diff line number Diff line change
Expand Up @@ -1089,12 +1089,14 @@ dissect_glow_ElementCollection(bool implicit_tag _U_, tvbuff_t *tvb _U_, int off
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);

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);
p_set_proto_depth(actx->pinfo, proto_id, recursion_depth);
return offset;
}

Expand All @@ -1121,12 +1123,14 @@ dissect_glow_Parameter(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _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);

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);
p_set_proto_depth(actx->pinfo, proto_id, recursion_depth);
return offset;
}

Expand Down Expand Up @@ -1179,12 +1183,14 @@ dissect_glow_Template(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _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);

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);
p_set_proto_depth(actx->pinfo, proto_id, recursion_depth);
return offset;
}

Expand Down
4 changes: 3 additions & 1 deletion epan/dissectors/packet-goose.c
Original file line number Diff line number Diff line change
Expand Up @@ -714,13 +714,15 @@ dissect_goose_Data(bool implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn
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);

offset = dissect_ber_choice(actx, tree, tvb, offset,
Data_choice, hf_index, ett_goose_Data,
NULL);

p_set_proto_depth(actx->pinfo, proto_id, recursion_depth - cycle_size);
p_set_proto_depth(actx->pinfo, proto_id, recursion_depth);
return offset;
}

Expand Down
8 changes: 6 additions & 2 deletions epan/dissectors/packet-h225.c
Original file line number Diff line number Diff line change
Expand Up @@ -3971,16 +3971,18 @@ dissect_h225_EnumeratedParameter(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *
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);

gef_ctx_t *parent_gefx;

parent_gefx = gef_ctx_get(actx->private_data);
actx->private_data = gef_ctx_alloc(actx->pinfo->pool, parent_gefx, NULL);
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);
p_set_proto_depth(actx->pinfo, proto_id, recursion_depth);
actx->private_data = parent_gefx;
return offset;
}
Expand All @@ -3997,8 +3999,10 @@ dissect_h225_GenericData(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _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);

void *priv_data = actx->private_data;
gef_ctx_t *gefx;

Expand All @@ -4011,7 +4015,7 @@ 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);
p_set_proto_depth(actx->pinfo, proto_id, recursion_depth);
actx->private_data = priv_data;
return offset;
}
Expand Down
Loading

0 comments on commit 9e19346

Please sign in to comment.