diff --git a/CVE-2023-0666.patch b/CVE-2023-0666.patch deleted file mode 100644 index c27b4f4ff1db6c7507e03a1518320a60329905b2..0000000000000000000000000000000000000000 --- a/CVE-2023-0666.patch +++ /dev/null @@ -1,116 +0,0 @@ -From 28fdce547c417b868c521f87fb58f71ca6b1e3f7 Mon Sep 17 00:00:00 2001 -From: Gerald Combs -Date: Thu, 18 May 2023 13:52:48 -0700 -Subject: [PATCH] RTPS: Fixup our g_strlcpy dest_sizes - -Use the proper dest_size in various g_strlcpy calls. - -Fixes #19085 ---- - epan/dissectors/packet-rtps.c | 22 +++++++++++----------- - 1 file changed, 11 insertions(+), 11 deletions(-) - -diff --git a/epan/dissectors/packet-rtps.c b/epan/dissectors/packet-rtps.c -index c152d50..f4da449 100644 ---- a/epan/dissectors/packet-rtps.c -+++ b/epan/dissectors/packet-rtps.c -@@ -4487,7 +4487,7 @@ static gint rtps_util_add_typecode(proto_tree *tree, tvbuff_t *tvb, gint offset, - ++tk_id; - } - -- (void) g_strlcpy(type_name, rtps_util_typecode_id_to_string(tk_id), 40); -+ (void) g_strlcpy(type_name, rtps_util_typecode_id_to_string(tk_id), sizeof(type_name)); - - /* Structure of the typecode data: - * -@@ -4658,7 +4658,7 @@ static gint rtps_util_add_typecode(proto_tree *tree, tvbuff_t *tvb, gint offset, - member_name, -1, NULL, ndds_40_hack); - } - /* Finally prints the name of the struct (if provided) */ -- (void) g_strlcpy(type_name, "}", 40); -+ (void) g_strlcpy(type_name, "}", sizeof(type_name)); - break; - - } /* end of case UNION */ -@@ -4829,7 +4829,7 @@ static gint rtps_util_add_typecode(proto_tree *tree, tvbuff_t *tvb, gint offset, - } - } - /* Finally prints the name of the struct (if provided) */ -- (void) g_strlcpy(type_name, "}", 40); -+ (void) g_strlcpy(type_name, "}", sizeof(type_name)); - break; - } - -@@ -4921,7 +4921,7 @@ static gint rtps_util_add_typecode(proto_tree *tree, tvbuff_t *tvb, gint offset, - offset += 4; - alias_name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, alias_name_length, ENC_ASCII); - offset = check_offset_addition(offset, alias_name_length, tree, NULL, tvb); -- (void) g_strlcpy(type_name, alias_name, 40); -+ (void) g_strlcpy(type_name, alias_name, sizeof(type_name)); - break; - } - -@@ -4956,7 +4956,7 @@ static gint rtps_util_add_typecode(proto_tree *tree, tvbuff_t *tvb, gint offset, - if (tk_id == RTI_CDR_TK_VALUE_PARAM) { - type_id_name = "valueparam"; - } -- g_snprintf(type_name, 40, "%s '%s'", type_id_name, value_name); -+ g_snprintf(type_name, sizeof(type_name), "%s '%s'", type_id_name, value_name); - break; - } - } /* switch(tk_id) */ -@@ -5120,7 +5120,7 @@ static gint rtps_util_add_type_library_type(proto_tree *tree, - long_number = tvb_get_guint32(tvb, offset_tmp, encoding); - name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset_tmp+4, long_number, ENC_ASCII); - if (info) -- (void) g_strlcpy(info->member_name, name, long_number); -+ (void) g_strlcpy(info->member_name, name, sizeof(info->member_name)); - - proto_item_append_text(tree, " %s", name); - offset = check_offset_addition(offset, member_length, tree, NULL, tvb); -@@ -5296,13 +5296,13 @@ static gint rtps_util_add_type_member(proto_tree *tree, - proto_item_append_text(tree, " %s (ID: %d)", name, member_id); - if (member_object) { - member_object->member_id = member_id; -- (void) g_strlcpy(member_object->member_name, name, long_number < 256 ? long_number : 256); -+ (void) g_strlcpy(member_object->member_name, name, sizeof(member_object->member_name)); - member_object->type_id = member_type_id; - } - if (info && info->extensibility == EXTENSIBILITY_MUTABLE) { - mutable_member_mapping * mutable_mapping = NULL; - mutable_mapping = wmem_new(wmem_file_scope(), mutable_member_mapping); -- (void) g_strlcpy(mutable_mapping->member_name, name, long_number < 256 ? long_number : 256); -+ (void) g_strlcpy(mutable_mapping->member_name, name, sizeof(mutable_mapping->member_name)); - mutable_mapping->struct_type_id = info->type_id; - mutable_mapping->member_type_id = member_type_id; - mutable_mapping->member_id = member_id; -@@ -5357,7 +5357,7 @@ static gint rtps_util_add_type_union_member(proto_tree *tree, - union_member_mapping * mapping = NULL; - - mapping = wmem_new(wmem_file_scope(), union_member_mapping); -- (void) g_strlcpy(mapping->member_name, object.member_name, 256); -+ (void) g_strlcpy(mapping->member_name, object.member_name, sizeof(mapping->member_name)); - mapping->member_type_id = object.type_id; - mapping->discriminator = HASHMAP_DISCRIMINATOR_CONSTANT; - mapping->union_type_id = union_type_id + mapping->discriminator; -@@ -5370,7 +5370,7 @@ static gint rtps_util_add_type_union_member(proto_tree *tree, - union_member_mapping * mapping = NULL; - - mapping = wmem_new(wmem_file_scope(), union_member_mapping); -- (void) g_strlcpy(mapping->member_name, object.member_name, 256); -+ (void) g_strlcpy(mapping->member_name, object.member_name, sizeof(mapping->member_name)); - mapping->member_type_id = object.type_id; - mapping->discriminator = -1; - mapping->union_type_id = union_type_id + mapping->discriminator; -@@ -5390,7 +5390,7 @@ static gint rtps_util_add_type_union_member(proto_tree *tree, - ti = proto_tree_add_item(labels, hf_rtps_type_object_union_label, tvb, offset_tmp, 4, encoding); - offset_tmp += 4; - -- (void) g_strlcpy(mapping->member_name, object.member_name, 256); -+ (void) g_strlcpy(mapping->member_name, object.member_name, sizeof(mapping->member_name)); - mapping->member_type_id = object.type_id; - mapping->discriminator = discriminator_case; - mapping->union_type_id = union_type_id + discriminator_case; --- -2.33.0 - diff --git a/CVE-2023-2906.patch b/CVE-2023-2906.patch deleted file mode 100644 index 1d56a77f7dcbae78b1cb130663e36eca0a257451..0000000000000000000000000000000000000000 --- a/CVE-2023-2906.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 0b874ad0f50f71a5b780cb915ea62f8625112402 Mon Sep 17 00:00:00 2001 -From: Jaap Keuter -Date: Thu, 27 Jul 2023 20:21:19 +0200 -Subject: [PATCH] CP2179: Handle timetag info response without records - -Fixes #19229 - -(cherry picked from commit 44dc70cc5aadca91cb8ba3710c59c3651b7b0d4d) ---- - epan/dissectors/packet-cp2179.c | 7 +++++-- - 1 file changed, 5 insertions(+), 2 deletions(-) - -diff --git a/epan/dissectors/packet-cp2179.c b/epan/dissectors/packet-cp2179.c -index 30f53f84946..70fe0332843 100644 ---- a/epan/dissectors/packet-cp2179.c -+++ b/epan/dissectors/packet-cp2179.c -@@ -721,11 +721,14 @@ dissect_response_frame(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int - proto_tree_add_item(cp2179_proto_tree, hf_cp2179_timetag_numsets, tvb, offset, 1, ENC_LITTLE_ENDIAN); - - num_records = tvb_get_guint8(tvb, offset) & 0x7F; -+ offset += 1; -+ -+ if (num_records == 0 || numberofcharacters <= 1) -+ break; -+ - recordsize = (numberofcharacters-1) / num_records; - num_values = (recordsize-6) / 2; /* Determine how many 16-bit analog values are present in each event record */ - -- offset += 1; -- - for (x = 0; x < num_records; x++) - { - cp2179_event_tree = proto_tree_add_subtree_format(cp2179_proto_tree, tvb, offset, recordsize, ett_cp2179_event, NULL, "Event Record # %d", x+1); --- -GitLab - diff --git a/CVE-2023-3648.patch b/CVE-2023-3648.patch deleted file mode 100644 index b93addb5960524e1d725a7f6786d020483289df8..0000000000000000000000000000000000000000 --- a/CVE-2023-3648.patch +++ /dev/null @@ -1,104 +0,0 @@ -From 146721324b8eab1a480dda86b5addae6c1820818 Mon Sep 17 00:00:00 2001 -From: John Thacker -Date: Sun, 28 May 2023 07:14:52 -0400 -Subject: [PATCH] kafka: Don't use after free - -Neither tvb_new_child_real_data() nor tvb_composite_append() copy -the real data buffer that they're given. So we can't free a -decompressed buffer after making it a tvb. - -We can realloc if the output size is smaller. - -Fix #19105 - - -(cherry picked from commit b673bc022aa28c2c381cb96cae09357bd27eb0df) ---- - epan/dissectors/packet-kafka.c | 24 +++++++++++++++++------- - 1 file changed, 17 insertions(+), 7 deletions(-) - -diff --git a/epan/dissectors/packet-kafka.c b/epan/dissectors/packet-kafka.c -index b530d2cf787..eabcc5d264d 100644 ---- a/epan/dissectors/packet-kafka.c -+++ b/epan/dissectors/packet-kafka.c -@@ -1677,7 +1677,6 @@ decompress_lz4(tvbuff_t *tvb, packet_info *pinfo, int offset, guint32 length, tv - dst_size = (size_t)lz4_info.contentSize; - } - -- decompressed_buffer = wmem_alloc(pinfo->pool, dst_size); - size_t out_size; - int count = 0; - -@@ -1687,12 +1686,16 @@ decompress_lz4(tvbuff_t *tvb, packet_info *pinfo, int offset, guint32 length, tv - goto end; - } - -+ decompressed_buffer = wmem_alloc(pinfo->pool, dst_size); - out_size = dst_size; - rc = LZ4F_decompress(lz4_ctxt, decompressed_buffer, &out_size, - &data[src_offset], &src_size, NULL); - if (LZ4F_isError(rc)) { - goto end; - } -+ if (out_size != dst_size) { -+ decompressed_buffer = (guint8 *)wmem_realloc(pinfo->pool, decompressed_buffer, out_size); -+ } - if (out_size == 0) { - goto end; - } -@@ -1734,7 +1737,7 @@ static gboolean - decompress_snappy(tvbuff_t *tvb, packet_info *pinfo, int offset, guint32 length, tvbuff_t **decompressed_tvb, int *decompressed_offset) - { - guint8 *data = (guint8*)tvb_memdup(pinfo->pool, tvb, offset, length); -- size_t uncompressed_size; -+ size_t uncompressed_size, out_size; - snappy_status rc = SNAPPY_OK; - tvbuff_t *composite_tvb = NULL; - gboolean ret = FALSE; -@@ -1771,18 +1774,21 @@ decompress_snappy(tvbuff_t *tvb, packet_info *pinfo, int offset, guint32 length, - goto end; - } - guint8 *decompressed_buffer = (guint8*)wmem_alloc(pinfo->pool, uncompressed_size); -- rc = snappy_uncompress(&data[pos], chunk_size, decompressed_buffer, &uncompressed_size); -+ out_size = uncompressed_size; -+ rc = snappy_uncompress(&data[pos], chunk_size, decompressed_buffer, &out_size); - if (rc != SNAPPY_OK) { - goto end; - } -+ if (out_size != uncompressed_size) { -+ decompressed_buffer = (guint8 *)wmem_realloc(pinfo->pool, decompressed_buffer, out_size); -+ } - - if (!composite_tvb) { - composite_tvb = tvb_new_composite(); - } - tvb_composite_append(composite_tvb, -- tvb_new_child_real_data(tvb, decompressed_buffer, (guint)uncompressed_size, (gint)uncompressed_size)); -+ tvb_new_child_real_data(tvb, decompressed_buffer, (guint)out_size, (gint)out_size)); - pos += chunk_size; -- wmem_free(pinfo->pool, decompressed_buffer); - count++; - DISSECTOR_ASSERT_HINT(count < MAX_LOOP_ITERATIONS, "MAX_LOOP_ITERATIONS exceeded"); - } -@@ -1797,12 +1803,16 @@ decompress_snappy(tvbuff_t *tvb, packet_info *pinfo, int offset, guint32 length, - - guint8 *decompressed_buffer = (guint8*)wmem_alloc(pinfo->pool, uncompressed_size); - -- rc = snappy_uncompress(data, length, decompressed_buffer, &uncompressed_size); -+ out_size = uncompressed_size; -+ rc = snappy_uncompress(data, length, decompressed_buffer, &out_size); - if (rc != SNAPPY_OK) { - goto end; - } -+ if (out_size != uncompressed_size) { -+ decompressed_buffer = (guint8 *)wmem_realloc(pinfo->pool, decompressed_buffer, out_size); -+ } - -- *decompressed_tvb = tvb_new_child_real_data(tvb, decompressed_buffer, (guint)uncompressed_size, (gint)uncompressed_size); -+ *decompressed_tvb = tvb_new_child_real_data(tvb, decompressed_buffer, (guint)out_size, (gint)out_size); - *decompressed_offset = 0; - - } --- -GitLab - diff --git a/CVE-2023-3649.patch b/CVE-2023-3649.patch deleted file mode 100644 index 5ee4a685cbd87226b98cfcf114bf3d933850dae1..0000000000000000000000000000000000000000 --- a/CVE-2023-3649.patch +++ /dev/null @@ -1,227 +0,0 @@ -From 75e0ffcb42f3816e5f2fdef12f3c9ae906130b0c Mon Sep 17 00:00:00 2001 -From: John Thacker -Date: Sat, 24 Jun 2023 00:34:50 -0400 -Subject: [PATCH] iscsi: Check bounds when extracting TargetAddress - -Use tvb_ functions that do bounds checking when parsing the -TargetAddress string, instead of incrementing a pointer to an -extracted char* and sometimes accidentally overrunning the -string. - -While we're there, go ahead and add support for IPv6 addresses. - -Fix #19164 - -(backported from commit 94349bbdaeb384b12d554dd65e7be7ceb0e93d21) ---- - epan/dissectors/packet-iscsi.c | 146 +++++++++++++++++---------------- - 1 file changed, 75 insertions(+), 71 deletions(-) - -diff --git a/epan/dissectors/packet-iscsi.c b/epan/dissectors/packet-iscsi.c -index 031f07e5aa6..3b5d64de9fd 100644 ---- a/epan/dissectors/packet-iscsi.c -+++ b/epan/dissectors/packet-iscsi.c -@@ -20,8 +20,6 @@ - - #include "config.h" - --#include -- - #include - #include - #include -@@ -29,6 +27,7 @@ - #include "packet-scsi.h" - #include - #include -+#include - #include - #include - -@@ -514,70 +513,81 @@ typedef struct _iscsi_conv_data { - dissector for the address/port that TargetAddress points to. - (it starts to be common to use redirectors to point to non-3260 ports) - */ -+static address null_address = ADDRESS_INIT_NONE; -+ - static void --iscsi_dissect_TargetAddress(packet_info *pinfo, tvbuff_t* tvb, proto_tree *tree, char *val, guint offset) -+iscsi_dissect_TargetAddress(packet_info *pinfo, tvbuff_t* tvb, proto_tree *tree, guint offset) - { -- address *addr = NULL; -+ address addr = ADDRESS_INIT_NONE; - guint16 port; -- char *value = wmem_strdup(pinfo->pool, val); -- char *p = NULL, *pgt = NULL; -- -- if (value[0] == '[') { -- /* this looks like an ipv6 address */ -- p = strchr(value, ']'); -- if (p != NULL) { -- *p = 0; -- p += 2; /* skip past "]:" */ -- -- pgt = strchr(p, ','); -- if (pgt != NULL) { -- *pgt++ = 0; -- } -+ int colon_offset; -+ int end_offset; -+ char *ip_str, *port_str; -+ -+ colon_offset = tvb_find_guint8(tvb, offset, -1, ':'); -+ if (colon_offset == -1) { -+ /* RFC 7143 13.8 TargetAddress "If the TCP port is not specified, -+ * it is assumed to be the IANA-assigned default port for iSCSI", -+ * so nothing to do here. -+ */ -+ return; -+ } - -- /* can't handle ipv6 yet */ -+ /* We found a colon, so there's at least one byte and this won't fail. */ -+ if (tvb_get_guint8(tvb, offset) == '[') { -+ offset++; -+ /* could be an ipv6 address */ -+ end_offset = tvb_find_guint8(tvb, offset, -1, ']'); -+ if (end_offset == -1) { -+ return; - } -- } else { -- /* This is either a ipv4 address or a dns name */ -- int i0,i1,i2,i3; -- if (sscanf(value, "%d.%d.%d.%d", &i0,&i1,&i2,&i3) == 4) { -- /* looks like a ipv4 address */ -- p = strchr(value, ':'); -- if (p != NULL) { -- char *addr_data; -- -- *p++ = 0; -- -- pgt = strchr(p, ','); -- if (pgt != NULL) { -- *pgt++ = 0; -- } - -- addr_data = (char *) wmem_alloc(pinfo->pool, 4); -- addr_data[0] = i0; -- addr_data[1] = i1; -- addr_data[2] = i2; -- addr_data[3] = i3; -- -- addr = wmem_new(pinfo->pool, address); -- addr->type = AT_IPv4; -- addr->len = 4; -- addr->data = addr_data; -+ /* look for the colon before the port, if any */ -+ colon_offset = tvb_find_guint8(tvb, end_offset, -1, ':'); -+ if (colon_offset == -1) { -+ return; -+ } - -- if (!ws_strtou16(p, NULL, &port)) { -- proto_tree_add_expert_format(tree, pinfo, &ei_iscsi_keyvalue_invalid, -- tvb, offset + (guint)strlen(value), (guint)strlen(p), "Invalid port: %s", p); -- } -- } -+ ws_in6_addr *ip6_addr = wmem_new(pinfo->pool, ws_in6_addr); -+ ip_str = tvb_get_string_enc(pinfo->pool, tvb, offset, end_offset - offset, ENC_ASCII); -+ if (ws_inet_pton6(ip_str, ip6_addr)) { -+ /* looks like a ipv6 address */ -+ set_address(&addr, AT_IPv6, sizeof(ws_in6_addr), ip6_addr); -+ } - -+ } else { -+ /* This is either a ipv4 address or a dns name */ -+ ip_str = tvb_get_string_enc(pinfo->pool, tvb, offset, colon_offset - offset, ENC_ASCII); -+ ws_in4_addr *ip4_addr = wmem_new(pinfo->pool, ws_in4_addr); -+ if (ws_inet_pton4(ip_str, ip4_addr)) { -+ /* looks like a ipv4 address */ -+ set_address(&addr, AT_IPv4, 4, ip4_addr); - } -+ /* else a DNS host name; we could, theoretically, try to use -+ * name resolution information in the capture to lookup the address. -+ */ - } - -+ /* Extract the port */ -+ end_offset = tvb_find_guint8(tvb, colon_offset, -1, ','); -+ int port_len; -+ if (end_offset == -1) { -+ port_len = tvb_reported_length_remaining(tvb, colon_offset + 1); -+ } else { -+ port_len = end_offset - (colon_offset + 1); -+ } -+ port_str = tvb_get_string_enc(pinfo->pool, tvb, colon_offset + 1, port_len, ENC_ASCII); -+ if (!ws_strtou16(port_str, NULL, &port)) { -+ proto_tree_add_expert_format(tree, pinfo, &ei_iscsi_keyvalue_invalid, -+ tvb, colon_offset + 1, port_len, "Invalid port: %s", port_str); -+ return; -+ } - - /* attach a conversation dissector to this address/port tuple */ -- if (addr && !pinfo->fd->visited) { -+ if (!addresses_equal(&addr, &null_address) && !pinfo->fd->visited) { - conversation_t *conv; - -- conv = conversation_new(pinfo->num, addr, addr, ENDPOINT_TCP, port, port, NO_ADDR2|NO_PORT2); -+ conv = conversation_new(pinfo->num, &addr, &null_address, ENDPOINT_TCP, port, 0, NO_ADDR2|NO_PORT2); - if (conv == NULL) { - return; - } -@@ -589,30 +599,24 @@ iscsi_dissect_TargetAddress(packet_info *pinfo, tvbuff_t* tvb, proto_tree *tree, - static gint - addTextKeys(packet_info *pinfo, proto_tree *tt, tvbuff_t *tvb, gint offset, guint32 text_len) { - const gint limit = offset + text_len; -+ tvbuff_t *keyvalue_tvb; -+ int len, value_offset; - - while(offset < limit) { -- char *key = NULL, *value = NULL; -- gint len = tvb_strnlen(tvb, offset, limit - offset); -- -- if(len == -1) { -- len = limit - offset; -- } else { -- len = len + 1; -- } -- -- key = tvb_get_string_enc(pinfo->pool, tvb, offset, len, ENC_ASCII); -- if (key == NULL) { -- break; -- } -- value = strchr(key, '='); -- if (value == NULL) { -+ /* RFC 7143 6.1 Text Format: "Every key=value pair, including the -+ * last or only pair in a LTDS, MUST be followed by one null (0x00) -+ * delimiter. -+ */ -+ proto_tree_add_item_ret_length(tt, hf_iscsi_KeyValue, tvb, offset, -1, ENC_ASCII, &len); -+ keyvalue_tvb = tvb_new_subset_length(tvb, offset, len); -+ value_offset = tvb_find_guint8(keyvalue_tvb, 0, len, '='); -+ if (value_offset == -1) { - break; - } -- *value++ = 0; -+ value_offset++; - -- proto_tree_add_item(tt, hf_iscsi_KeyValue, tvb, offset, len, ENC_ASCII|ENC_NA); -- if (!strcmp(key, "TargetAddress")) { -- iscsi_dissect_TargetAddress(pinfo, tvb, tt, value, offset + (guint)strlen("TargetAddress") + 2); -+ if (tvb_strneql(keyvalue_tvb, 0, "TargetAddress=", strlen("TargetAddress=")) == 0) { -+ iscsi_dissect_TargetAddress(pinfo, keyvalue_tvb, tt, value_offset); - } - - offset += len; -@@ -2943,7 +2947,7 @@ proto_register_iscsi(void) - }, - { &hf_iscsi_KeyValue, - { "KeyValue", "iscsi.keyvalue", -- FT_STRING, BASE_NONE, NULL, 0, -+ FT_STRINGZ, BASE_NONE, NULL, 0, - "Key/value pair", HFILL } - }, - { &hf_iscsi_Text_F, --- -GitLab - diff --git a/CVE-2023-4511.patch b/CVE-2023-4511.patch deleted file mode 100644 index ef31fa49ef98efc577ba996d396135577049b5a1..0000000000000000000000000000000000000000 --- a/CVE-2023-4511.patch +++ /dev/null @@ -1,80 +0,0 @@ -From d3068e8d2e80908ab284c2bcc96d3ff7f8a5c1ae Mon Sep 17 00:00:00 2001 -From: John Thacker -Date: Thu, 10 Aug 2023 05:29:09 -0400 -Subject: [PATCH] btsdp: Keep offset advancing - -hf_data_element_value is a FT_NONE, so we can add the item with -the expected length and get_hfi_length() will adjust the length -without throwing an exception. There's no need to add it with -zero length and call proto_item_set_len. Also, don't increment -the offset by 0 instead of the real length when there isn't -enough data in the packet, as that can lead to failing to advance -the offset. - -When dissecting a sequence type (sequence or alternative) and -recursing into the sequence member, instead of using the main -packet tvb directly, create a subset using the indicated length -of the sequence. That will properly throw an exception if a -contained item is larger than the containing sequence, instead of -dissecting the same bytes as several different items (inside -the sequence recursively, as well in the outer loop.) - -Fix #19258 - - -(cherry picked from commit ef9c79ae81b00a63aa8638076ec81dc9482972e9) ---- - epan/dissectors/packet-btsdp.c | 15 ++++++++------- - 1 file changed, 8 insertions(+), 7 deletions(-) - -diff --git a/epan/dissectors/packet-btsdp.c b/epan/dissectors/packet-btsdp.c -index 66265d6ef92..34d8ee80b89 100644 ---- a/epan/dissectors/packet-btsdp.c -+++ b/epan/dissectors/packet-btsdp.c -@@ -1925,13 +1925,11 @@ dissect_data_element(proto_tree *tree, proto_tree **next_tree, - offset += len - length; - } - -- pitem = proto_tree_add_item(ptree, hf_data_element_value, tvb, offset, 0, ENC_NA); -+ pitem = proto_tree_add_item(ptree, hf_data_element_value, tvb, offset, length, ENC_NA); - if (length > tvb_reported_length_remaining(tvb, offset)) { - expert_add_info(pinfo, pitem, &ei_data_element_value_large); -- length = 0; -- } -- proto_item_set_len(pitem, length); -- if (length == 0) -+ proto_item_append_text(pitem, ": MISSING"); -+ } else if (length == 0) - proto_item_append_text(pitem, ": MISSING"); - - if (next_tree) *next_tree = proto_item_add_subtree(pitem, ett_btsdp_data_element_value); -@@ -3523,6 +3521,8 @@ dissect_sdp_type(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, - gint bytes_to_go = size; - gint first = 1; - wmem_strbuf_t *substr; -+ tvbuff_t *next_tvb = tvb_new_subset_length(tvb, offset, size); -+ gint next_offset = 0; - - ti = proto_tree_add_item(next_tree, (type == 6) ? hf_data_element_value_sequence : hf_data_element_value_alternative, - tvb, offset, size, ENC_NA); -@@ -3537,14 +3537,15 @@ dissect_sdp_type(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, - first = 0; - } - -- size = dissect_sdp_type(st, pinfo, tvb, offset, attribute, service_uuid, -+ size = dissect_sdp_type(st, pinfo, next_tvb, next_offset, -+ attribute, service_uuid, - service_did_vendor_id, service_did_vendor_id_source, - service_hdp_data_exchange_specification, service_info, &substr); - if (size < 1) { - break; - } - wmem_strbuf_append_printf(info_buf, "%s ", wmem_strbuf_finalize(substr)); -- offset += size ; -+ next_offset += size; - bytes_to_go -= size; - } - --- -GitLab - diff --git a/CVE-2023-4513-1.patch b/CVE-2023-4513-1.patch deleted file mode 100644 index 5f29a38be6599164c9b31a2dea6154c51a138b9c..0000000000000000000000000000000000000000 --- a/CVE-2023-4513-1.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 863f6c3dc760ab770a7b31b33e9c769868e4289b Mon Sep 17 00:00:00 2001 -From: John Thacker -Date: Thu, 10 Aug 2023 01:19:21 -0400 -Subject: [PATCH] wmem: Fix leak in block_fast when realloc'ing jumbo blocks - -In block fast wmem_allocator is used, keep the double linked -list of jumbo blocks accurate by pointing the prev pointer of -the old head (if it exists) to the newly allocated jumbo block. - -This prevents a leak if a jumbo block which is not the most -recently added jumbo block is realloc'ed. If the prev pointer -isn't set properly, then all the jumbo blocks added afterwards -will be lost from the list and leaked. - -Fix #19259 - - -(cherry picked from commit d086f2733bc611eb310aafec51bd28d44166fa42) ---- - wsutil/wmem/wmem_allocator_block_fast.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/wsutil/wmem/wmem_allocator_block_fast.c b/wsutil/wmem/wmem_allocator_block_fast.c -index bdb8c2f75dc..117e9df6193 100644 ---- a/wsutil/wmem/wmem_allocator_block_fast.c -+++ b/wsutil/wmem/wmem_allocator_block_fast.c -@@ -97,6 +97,9 @@ wmem_block_fast_alloc(void *private_data, const size_t size) - size + WMEM_JUMBO_HEADER_SIZE + WMEM_CHUNK_HEADER_SIZE); - - block->next = allocator->jumbo_list; -+ if (block->next) { -+ block->next->prev = block; -+ } - block->prev = NULL; - allocator->jumbo_list = block; - --- -GitLab - diff --git a/CVE-2023-4513-2.patch b/CVE-2023-4513-2.patch deleted file mode 100644 index eacd0709206025575f130ed994efc94d2d4ee251..0000000000000000000000000000000000000000 --- a/CVE-2023-4513-2.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 016af38af0a27b14c8e2fb4fb3e2c4811bb0211b Mon Sep 17 00:00:00 2001 -From: John Thacker -Date: Thu, 10 Aug 2023 02:47:58 -0400 -Subject: [PATCH] btsdp: Finalize wmem_strbuf - -The allocated wmem_strbuf isn't used after this, so it can -be finalized to save a bit of memory. - -Related to #19259 - - -(cherry picked from commit 7fecc31427e0ec5e55ac2611df94678940c1df7d) ---- - epan/dissectors/packet-btsdp.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/epan/dissectors/packet-btsdp.c b/epan/dissectors/packet-btsdp.c -index a60b3051b4d..66265d6ef92 100644 ---- a/epan/dissectors/packet-btsdp.c -+++ b/epan/dissectors/packet-btsdp.c -@@ -3543,7 +3543,7 @@ dissect_sdp_type(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, - if (size < 1) { - break; - } -- wmem_strbuf_append_printf(info_buf, "%s ", wmem_strbuf_get_str(substr)); -+ wmem_strbuf_append_printf(info_buf, "%s ", wmem_strbuf_finalize(substr)); - offset += size ; - bytes_to_go -= size; - } --- -GitLab - diff --git a/CVE-2023-5371.patch b/CVE-2023-5371.patch deleted file mode 100644 index eef3bb8033ad3b3979b5866a28acd12f0bc94983..0000000000000000000000000000000000000000 --- a/CVE-2023-5371.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 1921740b0bf561941e0906884757831bde989add Mon Sep 17 00:00:00 2001 -From: John Thacker -Date: Wed, 6 Sep 2023 06:13:23 -0400 -Subject: [PATCH] RTPS: Check for signed overflow - -Origin: https://gitlab.com/wireshark/wireshark/-/commit/1921740b0bf561941e0906884757831bde989add - -The offset is a signed integer, and we use negative offsets -to mean "offset counting from the end of the tvb." That means -that we can still have an excessive loop without unsigned overflow -or running off the end of the tvb, if the result of adding a large -unsigned integer to the offset results in a small negative number. - -Just check if the result of the addition makes the offset move -backwards. - -Fix #19322 - -(backported from commit 0de07f8fe4f8e06da9084485e64a24c8f85a20f4) ---- - epan/dissectors/packet-rtps.c | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - -diff --git a/epan/dissectors/packet-rtps.c b/epan/dissectors/packet-rtps.c -index 82ac8f9436b..c152d50dfc6 100644 ---- a/epan/dissectors/packet-rtps.c -+++ b/epan/dissectors/packet-rtps.c -@@ -2474,13 +2474,14 @@ static const fragment_items rtps_frag_items = { - "RTPS fragments" - }; - --static guint32 check_offset_addition(guint32 offset, guint32 value, proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb) -+static gint check_offset_addition(gint offset, guint32 value, proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb) - { -- if (offset > G_MAXUINT32 - value) { -+ gint new_offset = offset + (gint)value; -+ if (new_offset < offset) { - proto_tree_add_expert_format(tree, pinfo, &ei_rtps_value_too_large, tvb, 0, 0, "Offset value too large: %u", value); - THROW(ReportedBoundsError); - } -- return offset + value; -+ return new_offset; - } - - static void rtps_util_dissect_parameter_header(tvbuff_t * tvb, gint * offset, --- -GitLab - diff --git a/CVE-2023-6175.patch b/CVE-2023-6175.patch deleted file mode 100644 index a9d147bc6bae8a96e5776efe934c3d2e43d23db2..0000000000000000000000000000000000000000 --- a/CVE-2023-6175.patch +++ /dev/null @@ -1,254 +0,0 @@ -From 197e96f05303af0340b7e626f2b15c2edbf350b0 Mon Sep 17 00:00:00 2001 -From: Guy Harris -Date: Tue, 17 Oct 2023 22:08:42 -0700 -Subject: [PATCH] netscreen: do bounds checking for each byte of packet data. - -Make sure each byte we add to the packet data from the file fits in the -buffer, rather than stuffing bytes into the buffer and checking -afterwards. - -This prevents a buffer overflow. - -Fixes #19404, which was filed as part of Trend Micro's Zero Day -Initiative as ZDI-CAN-22164. - -While we're at it, expand a comment and make error messages give some -more detail. - -(backported from commit 3be1c99180a6fc48c34ae4bfc79bfd840b29ae3e) ---- - wiretap/netscreen.c | 129 ++++++++++++++++++++++++++++++++------------ - 1 file changed, 96 insertions(+), 33 deletions(-) - -diff --git a/wiretap/netscreen.c b/wiretap/netscreen.c -index de872cdb8b1..6880171e0d1 100644 ---- a/wiretap/netscreen.c -+++ b/wiretap/netscreen.c -@@ -59,7 +59,12 @@ static gboolean netscreen_seek_read(wtap *wth, gint64 seek_off, - static gboolean parse_netscreen_packet(FILE_T fh, wtap_rec *rec, - Buffer* buf, char *line, int *err, gchar **err_info); - static int parse_single_hex_dump_line(char* rec, guint8 *buf, -- guint byte_offset); -+ guint byte_offset, guint pkt_len); -+ -+/* Error returns from parse_single_hex_dump_line() */ -+#define PARSE_LINE_INVALID_CHARACTER -1 -+#define PARSE_LINE_NO_BYTES_SEEN -2 -+#define PARSE_LINE_TOO_MANY_BYTES_SEEN -3 - - static int netscreen_file_type_subtype = -1; - -@@ -245,13 +250,40 @@ netscreen_seek_read(wtap *wth, gint64 seek_off, wtap_rec *rec, Buffer *buf, - 2c 21 b6 d3 20 60 0c 8c 35 98 88 cf 20 91 0e a9 ,!...`..5....... - 1d 0b .. - -+ * The first line of a packet is in the form -+ -+.: ({i,o}) len=:> - -+ * where: -+ * -+ * and are a time stamp in seconds and deciseconds, -+ * giving the time since the firewall was booted; -+ * -+ * is the name of the interface on which the packet was -+ * received or on which it was transmitted; -+ * -+ * {i,o} is i for a received packet and o for a transmitted packet; -+ * -+ * is the length of the packet on the network; -+ * -+ * , at least for Ethernet, appears to be a source MAC -+ * address, folowed by "->", folowed by a destination MAC -+ * address, followed by a sequence of Ethertypes, each -+ * preceded by a "/" (multiple Ethertypes if there are VLAN -+ * tags and the like), possibly followed by ", tag ". -+ * -+ * Following that may be some "info lines", each of which is indented -+ * by 14 spaces, giving a dissection of the payload after the -+ * link-layer header. -+ * -+ * Following that is a hex/ASCII dump of the contents of the -+ * packet, with 16 octets per line. - */ - static gboolean - parse_netscreen_packet(FILE_T fh, wtap_rec *rec, Buffer* buf, - char *line, int *err, gchar **err_info) - { -- int pkt_len; -+ guint pkt_len; - int sec; - int dsec; - char cap_int[NETSCREEN_MAX_INT_NAME_LENGTH]; -@@ -271,25 +303,20 @@ parse_netscreen_packet(FILE_T fh, wtap_rec *rec, Buffer* buf, - memset(cap_int, 0, sizeof(cap_int)); - memset(cap_dst, 0, sizeof(cap_dst)); - -- if (sscanf(line, "%9d.%9d: %15[a-z0-9/:.-](%1[io]) len=%9d:%12s->%12s/", -+ if (sscanf(line, "%9d.%9d: %15[a-z0-9/:.-](%1[io]) len=%9u:%12s->%12s/", - &sec, &dsec, cap_int, direction, &pkt_len, cap_src, cap_dst) < 5) { - *err = WTAP_ERR_BAD_FILE; - *err_info = g_strdup("netscreen: Can't parse packet-header"); - return -1; - } -- if (pkt_len < 0) { -- *err = WTAP_ERR_BAD_FILE; -- *err_info = g_strdup("netscreen: packet header has a negative packet length"); -- return FALSE; -- } -- if ((guint)pkt_len > WTAP_MAX_PACKET_SIZE_STANDARD) { -+ if (pkt_len > WTAP_MAX_PACKET_SIZE_STANDARD) { - /* - * Probably a corrupt capture file; don't blow up trying - * to allocate space for an immensely-large packet. - */ - *err = WTAP_ERR_BAD_FILE; - *err_info = g_strdup_printf("netscreen: File has %u-byte packet, bigger than maximum of %u", -- (guint)pkt_len, WTAP_MAX_PACKET_SIZE_STANDARD); -+ pkt_len, WTAP_MAX_PACKET_SIZE_STANDARD); - return FALSE; - } - -@@ -328,44 +355,71 @@ parse_netscreen_packet(FILE_T fh, wtap_rec *rec, Buffer* buf, - break; - } - -- n = parse_single_hex_dump_line(p, pd, offset); -+ n = parse_single_hex_dump_line(p, pd, offset, pkt_len); - -- /* the smallest packet has a length of 6 bytes, if -- * the first hex-data is less then check whether -- * it is a info-line and act accordingly -+ /* -+ * The smallest packet has a length of 6 bytes. -+ * If the first line either gets an error when -+ * parsed as hex data, or has fewer than 6 -+ * bytes of hex data, check whether it's an -+ * info line by see if it has at least -+ * NETSCREEN_SPACES_ON_INFO_LINE spaces at the -+ * beginning. -+ * -+ * If it does, count this line and, if we have, -+ * so far, skipped no more than NETSCREEN_MAX_INFOLINES -+ * lines, skip this line. - */ - if (offset == 0 && n < 6) { - if (info_line(line)) { -+ /* Info line */ - if (++i <= NETSCREEN_MAX_INFOLINES) { -+ /* Skip this line */ - continue; - } - } else { -- *err = WTAP_ERR_BAD_FILE; -- *err_info = g_strdup("netscreen: cannot parse hex-data"); -- return FALSE; -+ if (n >= 0) { -+ *err = WTAP_ERR_BAD_FILE; -+ *err_info = g_strdup("netscreen: first line of packet data has only %d hex bytes, < 6"); -+ return FALSE; -+ } -+ /* Otherwise, fall through to report error */ - } - } - - /* If there is no more data and the line was not empty, - * then there must be an error in the file - */ -- if (n == -1) { -- *err = WTAP_ERR_BAD_FILE; -- *err_info = g_strdup("netscreen: cannot parse hex-data"); -+ if (n < 0) { -+ switch (n) { -+ -+ case PARSE_LINE_INVALID_CHARACTER: -+ *err = WTAP_ERR_BAD_FILE; -+ *err_info = g_strdup("netscreen: invalid character in hex data"); -+ break; -+ -+ case PARSE_LINE_NO_BYTES_SEEN: -+ *err = WTAP_ERR_BAD_FILE; -+ *err_info = g_strdup("netscreen: no hex bytes seen in hex data"); -+ break; -+ -+ case PARSE_LINE_TOO_MANY_BYTES_SEEN: -+ *err = WTAP_ERR_BAD_FILE; -+ *err_info = g_strdup("netscreen: number of hex bytes seen in hex data is greater than the packet length"); -+ break; -+ -+ default: -+ *err = WTAP_ERR_INTERNAL; -+ *err_info = g_strdup_printf("netscreen: unknown error %d from parse_single_hex_dump_line()", n); -+ break; -+ } -+ - return FALSE; - } - - /* Adjust the offset to the data that was just added to the buffer */ - offset += n; - -- /* If there was more hex-data than was announced in the len=x -- * header, then then there must be an error in the file -- */ -- if (offset > pkt_len) { -- *err = WTAP_ERR_BAD_FILE; -- *err_info = g_strdup("netscreen: too much hex-data"); -- return FALSE; -- } - } - - /* -@@ -405,7 +459,7 @@ parse_netscreen_packet(FILE_T fh, wtap_rec *rec, Buffer* buf, - * - * Returns number of bytes successfully read, -1 if bad. */ - static int --parse_single_hex_dump_line(char* rec, guint8 *buf, guint byte_offset) -+parse_single_hex_dump_line(char* rec, guint8 *buf, guint byte_offset, guint pkt_len) - { - int num_items_scanned; - guint8 character; -@@ -424,7 +478,7 @@ parse_single_hex_dump_line(char* rec, guint8 *buf, guint byte_offset) - /* Nothing more to parse */ - break; - } else -- return -1; /* not a hex digit, space before ASCII dump, or EOL */ -+ return PARSE_LINE_INVALID_CHARACTER; /* not a hex digit, space before ASCII dump, or EOL */ - byte <<= 4; - character = *rec++ & 0xFF; - if (character >= '0' && character <= '9') -@@ -434,7 +488,16 @@ parse_single_hex_dump_line(char* rec, guint8 *buf, guint byte_offset) - else if (character >= 'a' && character <= 'f') - byte += character - 'a' + 0xa; - else -- return -1; /* not a hex digit */ -+ return PARSE_LINE_INVALID_CHARACTER; /* not a hex digit */ -+ -+ /* If there was more hex-data than was announced in the len=x -+ * header, then there must be an error in the file; quit -+ * now, as adding this byte will overflow the buffer. -+ */ -+ if (byte_offset + num_items_scanned >= pkt_len) { -+ return PARSE_LINE_TOO_MANY_BYTES_SEEN; -+ } -+ - buf[byte_offset + num_items_scanned] = byte; - character = *rec++ & 0xFF; - if (character == '\0' || character == '\r' || character == '\n') { -@@ -442,11 +505,11 @@ parse_single_hex_dump_line(char* rec, guint8 *buf, guint byte_offset) - break; - } else if (character != ' ') { - /* not space before ASCII dump */ -- return -1; -+ return PARSE_LINE_INVALID_CHARACTER; - } - } - if (num_items_scanned == 0) -- return -1; -+ return PARSE_LINE_NO_BYTES_SEEN; - - return num_items_scanned; - } --- -GitLab - diff --git a/CVE-2024-0208.patch b/CVE-2024-0208.patch deleted file mode 100644 index 2420a119d767bcd9b58a38b10fd49588ad51de96..0000000000000000000000000000000000000000 --- a/CVE-2024-0208.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 4953fa99e78ce86e98c18d438dac00669956965c Mon Sep 17 00:00:00 2001 -From: John Thacker -Date: Thu, 23 Nov 2023 13:47:51 -0500 -Subject: [PATCH] gvcp: Don't try to add a NULL string to a column - -Origin: https://gitlab.com/wireshark/wireshark/-/merge_requests/13417 - -This was caught as an invalid argument by g_strlcpy before 4.2, -but it was never a good idea. - -Fix #19496 - -(backported from commit a8586fde3a6512466afb2a660538ef3fe712076b) ---- - epan/dissectors/packet-gvcp.c | 7 ++----- - 1 file changed, 2 insertions(+), 5 deletions(-) - -diff --git a/epan/dissectors/packet-gvcp.c b/epan/dissectors/packet-gvcp.c -index a7c13684f03..732db590e4a 100644 ---- a/epan/dissectors/packet-gvcp.c -+++ b/epan/dissectors/packet-gvcp.c -@@ -2222,15 +2222,12 @@ static void dissect_readreg_ack(proto_tree *gvcp_telegram_tree, tvbuff_t *tvb, p - if (addr_list_size > 0) - { - address_string = get_register_name_from_address(*((guint32*)wmem_array_index(gvcp_trans->addr_list, 0)), gvcp_info, &is_custom_register); -+ col_append_str(pinfo->cinfo, COL_INFO, address_string); - } - - if (num_registers) - { -- col_append_fstr(pinfo->cinfo, COL_INFO, "%s Value=0x%08X", address_string, tvb_get_ntohl(tvb, offset)); -- } -- else -- { -- col_append_str(pinfo->cinfo, COL_INFO, address_string); -+ col_append_sep_fstr(pinfo->cinfo, COL_INFO, " ", "Value=0x%08X", tvb_get_ntohl(tvb, offset)); - } - } - } --- -GitLab - diff --git a/CVE-2024-0209.patch b/CVE-2024-0209.patch deleted file mode 100644 index 7fb09a93d77d48454bf4a899fdbbb187673662c2..0000000000000000000000000000000000000000 --- a/CVE-2024-0209.patch +++ /dev/null @@ -1,2197 +0,0 @@ -From 5e949867190ab33b36797a2c8a58a7af6f0476af Mon Sep 17 00:00:00 2001 -From: Gerald Combs -Date: Sun, 31 Dec 2023 15:06:40 -0800 -Subject: [PATCH] asn2wrs: Add recursion checks - -Origin: https://gitlab.com/wireshark/wireshark/-/merge_requests/13869 - -Add a recursion depth check whenever we have cyclic dependencies. -Regenerate our dissectors. - -Fixes #19501 - -(cherry picked from commit 8f797db63ca44875a07d0d8a5d298a79d09b44ec) - -Conflicts: - epan/dissectors/asn1/x509sat/packet-x509sat-template.c - epan/dissectors/packet-cmip.c - epan/dissectors/packet-cmp.c - epan/dissectors/packet-dap.c - epan/dissectors/packet-disp.c - epan/dissectors/packet-e2ap.c - epan/dissectors/packet-glow.c - epan/dissectors/packet-goose.c - epan/dissectors/packet-h225.c - epan/dissectors/packet-h245.c - epan/dissectors/packet-h248.c - epan/dissectors/packet-ieee1609dot2.c - epan/dissectors/packet-ldap.c - epan/dissectors/packet-mms.c - epan/dissectors/packet-p22.c - epan/dissectors/packet-p7.c - epan/dissectors/packet-x509if.c - epan/dissectors/packet-x509sat.c - epan/dissectors/packet-z3950.c ---- - .../asn1/cmip/packet-cmip-template.c | 1 + - .../dissectors/asn1/cmp/packet-cmp-template.c | 1 + - .../dissectors/asn1/dap/packet-dap-template.c | 1 + - .../asn1/disp/packet-disp-template.c | 1 + - .../asn1/glow/packet-glow-template.c | 1 + - .../asn1/goose/packet-goose-template.c | 1 + - .../asn1/h245/packet-h245-template.c | 1 + - .../asn1/h248/packet-h248-template.c | 1 + - .../asn1/ldap/packet-ldap-template.c | 1 + - .../dissectors/asn1/p22/packet-p22-template.c | 1 + - epan/dissectors/asn1/p7/packet-p7-template.c | 1 + - .../asn1/x509if/packet-x509if-template.c | 1 + - .../asn1/x509sat/packet-x509sat-template.c | 1 + - epan/dissectors/packet-cmip.c | 24 +++++--- - epan/dissectors/packet-cmp.c | 20 +++++-- - epan/dissectors/packet-dap.c | 44 ++++++++++++--- - epan/dissectors/packet-disp.c | 26 +++++++-- - epan/dissectors/packet-glow.c | 30 ++++++++-- - epan/dissectors/packet-goose.c | 18 ++++-- - epan/dissectors/packet-h225.c | 13 +++++ - epan/dissectors/packet-h245.c | 56 +++++++++++++++++-- - epan/dissectors/packet-h248.c | 18 ++++-- - epan/dissectors/packet-ieee1609dot2.c | 7 +++ - epan/dissectors/packet-its.c | 17 ++++-- - epan/dissectors/packet-ldap.c | 20 +++++-- - epan/dissectors/packet-mms.c | 25 +++++++++ - epan/dissectors/packet-p22.c | 40 ++++++++++--- - epan/dissectors/packet-p7.c | 28 ++++++---- - epan/dissectors/packet-sv.c | 10 ++-- - epan/dissectors/packet-x509if.c | 32 +++++++++-- - epan/dissectors/packet-x509sat.c | 22 +++++--- - epan/dissectors/packet-z3950.c | 19 +++++++ - tools/asn2wrs.py | 36 ++++++++++++ - 33 files changed, 422 insertions(+), 96 deletions(-) - -diff --git a/epan/dissectors/asn1/cmip/packet-cmip-template.c b/epan/dissectors/asn1/cmip/packet-cmip-template.c -index dbac6c6b546..53caeb034eb 100644 ---- a/epan/dissectors/asn1/cmip/packet-cmip-template.c -+++ b/epan/dissectors/asn1/cmip/packet-cmip-template.c -@@ -15,6 +15,7 @@ - #include - #include - #include -+#include - - #include "packet-ber.h" - #include "packet-acse.h" -diff --git a/epan/dissectors/asn1/cmp/packet-cmp-template.c b/epan/dissectors/asn1/cmp/packet-cmp-template.c -index 21e3b27ed44..d9c02452260 100644 ---- a/epan/dissectors/asn1/cmp/packet-cmp-template.c -+++ b/epan/dissectors/asn1/cmp/packet-cmp-template.c -@@ -18,6 +18,7 @@ - - #include - #include -+#include - #include "packet-ber.h" - #include "packet-cmp.h" - #include "packet-crmf.h" -diff --git a/epan/dissectors/asn1/dap/packet-dap-template.c b/epan/dissectors/asn1/dap/packet-dap-template.c -index c5884becd66..8c14a03ba36 100644 ---- a/epan/dissectors/asn1/dap/packet-dap-template.c -+++ b/epan/dissectors/asn1/dap/packet-dap-template.c -@@ -16,6 +16,7 @@ - #include - #include - #include -+#include - - #include "packet-ber.h" - #include "packet-acse.h" -diff --git a/epan/dissectors/asn1/disp/packet-disp-template.c b/epan/dissectors/asn1/disp/packet-disp-template.c -index a28aa4e8e3d..b76959de22a 100644 ---- a/epan/dissectors/asn1/disp/packet-disp-template.c -+++ b/epan/dissectors/asn1/disp/packet-disp-template.c -@@ -16,6 +16,7 @@ - #include - #include - #include -+#include - - #include "packet-ber.h" - #include "packet-acse.h" -diff --git a/epan/dissectors/asn1/glow/packet-glow-template.c b/epan/dissectors/asn1/glow/packet-glow-template.c -index af6f16fb209..088d3c53332 100644 ---- a/epan/dissectors/asn1/glow/packet-glow-template.c -+++ b/epan/dissectors/asn1/glow/packet-glow-template.c -@@ -13,6 +13,7 @@ - # include "config.h" - - #include -+#include - #include "packet-ber.h" - - #define PNAME "Glow" -diff --git a/epan/dissectors/asn1/goose/packet-goose-template.c b/epan/dissectors/asn1/goose/packet-goose-template.c -index 142a272ee02..9a78db4c256 100644 ---- a/epan/dissectors/asn1/goose/packet-goose-template.c -+++ b/epan/dissectors/asn1/goose/packet-goose-template.c -@@ -16,6 +16,7 @@ - - #include - #include -+#include - #include - #include - -diff --git a/epan/dissectors/asn1/h245/packet-h245-template.c b/epan/dissectors/asn1/h245/packet-h245-template.c -index b71edc7288d..1ee778cf9a0 100644 ---- a/epan/dissectors/asn1/h245/packet-h245-template.c -+++ b/epan/dissectors/asn1/h245/packet-h245-template.c -@@ -28,6 +28,7 @@ - #include - #include - #include -+#include - #include - #include - #include "packet-tpkt.h" -diff --git a/epan/dissectors/asn1/h248/packet-h248-template.c b/epan/dissectors/asn1/h248/packet-h248-template.c -index af1a2ba83cc..514c899396d 100644 ---- a/epan/dissectors/asn1/h248/packet-h248-template.c -+++ b/epan/dissectors/asn1/h248/packet-h248-template.c -@@ -18,6 +18,7 @@ - #include - #include - #include -+#include - #include - #include - #include -diff --git a/epan/dissectors/asn1/ldap/packet-ldap-template.c b/epan/dissectors/asn1/ldap/packet-ldap-template.c -index b9313819996..0021c5641e0 100644 ---- a/epan/dissectors/asn1/ldap/packet-ldap-template.c -+++ b/epan/dissectors/asn1/ldap/packet-ldap-template.c -@@ -80,6 +80,7 @@ - #include - #include - #include -+#include - #include - #include - #include -diff --git a/epan/dissectors/asn1/p22/packet-p22-template.c b/epan/dissectors/asn1/p22/packet-p22-template.c -index f0cf69afbda..fe7d4d2ddee 100644 ---- a/epan/dissectors/asn1/p22/packet-p22-template.c -+++ b/epan/dissectors/asn1/p22/packet-p22-template.c -@@ -14,6 +14,7 @@ - #include - #include - #include -+#include - - #include "packet-ber.h" - #include "packet-acse.h" -diff --git a/epan/dissectors/asn1/p7/packet-p7-template.c b/epan/dissectors/asn1/p7/packet-p7-template.c -index 4df623bac03..621aa9b0392 100644 ---- a/epan/dissectors/asn1/p7/packet-p7-template.c -+++ b/epan/dissectors/asn1/p7/packet-p7-template.c -@@ -15,6 +15,7 @@ - #include - #include - #include -+#include - - #include "packet-ber.h" - #include "packet-acse.h" -diff --git a/epan/dissectors/asn1/x509if/packet-x509if-template.c b/epan/dissectors/asn1/x509if/packet-x509if-template.c -index cc75f93a7bc..10de0ec8eb3 100644 ---- a/epan/dissectors/asn1/x509if/packet-x509if-template.c -+++ b/epan/dissectors/asn1/x509if/packet-x509if-template.c -@@ -14,6 +14,7 @@ - #include - #include - #include -+#include - #include - - #include "packet-ber.h" -diff --git a/epan/dissectors/asn1/x509sat/packet-x509sat-template.c b/epan/dissectors/asn1/x509sat/packet-x509sat-template.c -index 1166e33ba48..d2640228a5c 100644 ---- a/epan/dissectors/asn1/x509sat/packet-x509sat-template.c -+++ b/epan/dissectors/asn1/x509sat/packet-x509sat-template.c -@@ -14,6 +14,7 @@ - #include - #include - #include -+#include - - #include "packet-ber.h" - #include "packet-p1.h" -diff --git a/epan/dissectors/packet-cmip.c b/epan/dissectors/packet-cmip.c -index 56277dc8404..eeb8deeb027 100644 ---- a/epan/dissectors/packet-cmip.c -+++ b/epan/dissectors/packet-cmip.c -@@ -23,6 +23,7 @@ - #include - #include - #include -+#include - - #include "packet-ber.h" - #include "packet-acse.h" -@@ -328,7 +329,7 @@ static int hf_cmip_T_daysOfWeek_friday = -1; - static int hf_cmip_T_daysOfWeek_saturday = -1; - - /*--- End of included file: packet-cmip-hf.c ---*/ --#line 43 "./asn1/cmip/packet-cmip-template.c" -+#line 44 "./asn1/cmip/packet-cmip-template.c" - - /* Initialize the subtree pointers */ - static gint ett_cmip = -1; -@@ -458,7 +459,7 @@ static gint ett_cmip_T_modificationList = -1; - static gint ett_cmip_T_modificationList_item = -1; - - /*--- End of included file: packet-cmip-ett.c ---*/ --#line 47 "./asn1/cmip/packet-cmip-template.c" -+#line 48 "./asn1/cmip/packet-cmip-template.c" - - static expert_field ei_wrong_spdu_type = EI_INIT; - -@@ -521,7 +522,7 @@ static const value_string cmip_error_code_vals[] = { - - - /*--- End of included file: packet-cmip-table.c ---*/ --#line 58 "./asn1/cmip/packet-cmip-template.c" -+#line 59 "./asn1/cmip/packet-cmip-template.c" - - static int opcode_type; - #define OPCODE_INVOKE 1 -@@ -620,7 +621,7 @@ static const char *object_identifier_id; - #define noInvokeId NULL - - /*--- End of included file: packet-cmip-val.h ---*/ --#line 68 "./asn1/cmip/packet-cmip-template.c" -+#line 69 "./asn1/cmip/packet-cmip-template.c" - - /*--- Included file: packet-cmip-fn.c ---*/ - #line 1 "./asn1/cmip/packet-cmip-fn.c" -@@ -631,6 +632,7 @@ static const char *object_identifier_id; - static int dissect_cmip_CMISFilter(gboolean 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 -@@ -1050,10 +1052,16 @@ static const ber_choice_t CMISFilter_choice[] = { - - static int - dissect_cmip_CMISFilter(gboolean 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); - 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); - return offset; - } - -@@ -4454,7 +4462,7 @@ static int dissect_WeekMask_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto - - - /*--- End of included file: packet-cmip-fn.c ---*/ --#line 69 "./asn1/cmip/packet-cmip-template.c" -+#line 70 "./asn1/cmip/packet-cmip-template.c" - - - -@@ -5635,7 +5643,7 @@ void proto_register_cmip(void) { - NULL, HFILL }}, - - /*--- End of included file: packet-cmip-hfarr.c ---*/ --#line 145 "./asn1/cmip/packet-cmip-template.c" -+#line 146 "./asn1/cmip/packet-cmip-template.c" - }; - - /* List of subtrees */ -@@ -5767,7 +5775,7 @@ void proto_register_cmip(void) { - &ett_cmip_T_modificationList_item, - - /*--- End of included file: packet-cmip-ettarr.c ---*/ --#line 151 "./asn1/cmip/packet-cmip-template.c" -+#line 152 "./asn1/cmip/packet-cmip-template.c" - }; - - static ei_register_info ei[] = { -@@ -5862,7 +5870,7 @@ void proto_register_cmip(void) { - - - /*--- End of included file: packet-cmip-dis-tab.c ---*/ --#line 170 "./asn1/cmip/packet-cmip-template.c" -+#line 171 "./asn1/cmip/packet-cmip-template.c" - oid_add_from_string("discriminatorId(1)","2.9.3.2.7.1"); - - attribute_id_dissector_table = register_dissector_table("cmip.attribute_id", "CMIP Attribute Id", proto_cmip, FT_UINT32, BASE_DEC); -diff --git a/epan/dissectors/packet-cmp.c b/epan/dissectors/packet-cmp.c -index 6f6febdaf51..f6b3ac3fb18 100644 ---- a/epan/dissectors/packet-cmp.c -+++ b/epan/dissectors/packet-cmp.c -@@ -26,6 +26,7 @@ - - #include - #include -+#include - #include "packet-ber.h" - #include "packet-cmp.h" - #include "packet-crmf.h" -@@ -224,7 +225,7 @@ static int hf_cmp_PKIFailureInfo_systemFailure = -1; - static int hf_cmp_PKIFailureInfo_duplicateCertReq = -1; - - /*--- End of included file: packet-cmp-hf.c ---*/ --#line 56 "./asn1/cmp/packet-cmp-template.c" -+#line 57 "./asn1/cmp/packet-cmp-template.c" - - /* Initialize the subtree pointers */ - static gint ett_cmp = -1; -@@ -280,7 +281,7 @@ static gint ett_cmp_PollRepContent = -1; - static gint ett_cmp_PollRepContent_item = -1; - - /*--- End of included file: packet-cmp-ett.c ---*/ --#line 60 "./asn1/cmp/packet-cmp-template.c" -+#line 61 "./asn1/cmp/packet-cmp-template.c" - - /*--- Included file: packet-cmp-fn.c ---*/ - #line 1 "./asn1/cmp/packet-cmp-fn.c" -@@ -290,6 +291,7 @@ static gint ett_cmp_PollRepContent_item = -1; - /*int dissect_cmp_PKIMessage(gboolean 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 const value_string cmp_CMPCertificate_vals[] = { - { 0, "x509v3PKCert" }, -@@ -1106,9 +1108,15 @@ static const ber_sequence_t PKIMessage_sequence[] = { - - int - dissect_cmp_PKIMessage(gboolean 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 = 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); - return offset; - } - -@@ -1463,7 +1471,7 @@ static int dissect_SuppLangTagsValue_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _ - - - /*--- End of included file: packet-cmp-fn.c ---*/ --#line 61 "./asn1/cmp/packet-cmp-template.c" -+#line 62 "./asn1/cmp/packet-cmp-template.c" - - static int - dissect_cmp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) -@@ -2342,7 +2350,7 @@ void proto_register_cmp(void) { - NULL, HFILL }}, - - /*--- End of included file: packet-cmp-hfarr.c ---*/ --#line 303 "./asn1/cmp/packet-cmp-template.c" -+#line 304 "./asn1/cmp/packet-cmp-template.c" - }; - - /* List of subtrees */ -@@ -2400,7 +2408,7 @@ void proto_register_cmp(void) { - &ett_cmp_PollRepContent_item, - - /*--- End of included file: packet-cmp-ettarr.c ---*/ --#line 309 "./asn1/cmp/packet-cmp-template.c" -+#line 310 "./asn1/cmp/packet-cmp-template.c" - }; - module_t *cmp_module; - -@@ -2487,7 +2495,7 @@ void proto_reg_handoff_cmp(void) { - - - /*--- End of included file: packet-cmp-dis-tab.c ---*/ --#line 374 "./asn1/cmp/packet-cmp-template.c" -+#line 375 "./asn1/cmp/packet-cmp-template.c" - inited = TRUE; - } - -diff --git a/epan/dissectors/packet-dap.c b/epan/dissectors/packet-dap.c -index af21d0f31d3..e2e2ec8c81c 100644 ---- a/epan/dissectors/packet-dap.c -+++ b/epan/dissectors/packet-dap.c -@@ -24,6 +24,7 @@ - #include - #include - #include -+#include - - #include "packet-ber.h" - #include "packet-acse.h" -@@ -463,7 +464,7 @@ static int hf_dap_SearchControlOptions_separateFamilyMembers = -1; - static int hf_dap_SearchControlOptions_searchFamily = -1; - - /*--- End of included file: packet-dap-hf.c ---*/ --#line 49 "./asn1/dap/packet-dap-template.c" -+#line 50 "./asn1/dap/packet-dap-template.c" - - /* Initialize the subtree pointers */ - static gint ett_dap = -1; -@@ -642,7 +643,7 @@ static gint ett_dap_UpdateError = -1; - static gint ett_dap_T_signedUpdateError = -1; - - /*--- End of included file: packet-dap-ett.c ---*/ --#line 53 "./asn1/dap/packet-dap-template.c" -+#line 54 "./asn1/dap/packet-dap-template.c" - - static expert_field ei_dap_anonymous = EI_INIT; - -@@ -669,7 +670,7 @@ static expert_field ei_dap_anonymous = EI_INIT; - #define id_errcode_dsaReferral 9 - - /*--- End of included file: packet-dap-val.h ---*/ --#line 57 "./asn1/dap/packet-dap-template.c" -+#line 58 "./asn1/dap/packet-dap-template.c" - - - /*--- Included file: packet-dap-table.c ---*/ -@@ -707,7 +708,7 @@ static const value_string dap_err_code_string_vals[] = { - - - /*--- End of included file: packet-dap-table.c ---*/ --#line 59 "./asn1/dap/packet-dap-template.c" -+#line 60 "./asn1/dap/packet-dap-template.c" - - - /*--- Included file: packet-dap-fn.c ---*/ -@@ -730,6 +731,7 @@ static int dissect_dap_ListResultData(gboolean implicit_tag _U_, tvbuff_t *tvb _ - static int dissect_dap_SearchResultData(gboolean 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. - - const value_string dap_FamilyGrouping_vals[] = { - { 1, "entryOnly" }, -@@ -1294,9 +1296,15 @@ static const ber_sequence_t FamilyEntries_sequence[] = { - - static int - dissect_dap_FamilyEntries(gboolean 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 = 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); - return offset; - } - -@@ -1492,10 +1500,16 @@ static const ber_choice_t Filter_choice[] = { - - int - dissect_dap_Filter(gboolean 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); - 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); - return offset; - } - -@@ -2948,10 +2962,16 @@ static const ber_choice_t ListResultData_choice[] = { - - static int - dissect_dap_ListResultData(gboolean 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 = 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); - return offset; - } - -@@ -3333,10 +3353,16 @@ static const ber_choice_t SearchResultData_choice[] = { - - static int - dissect_dap_SearchResultData(gboolean 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 = 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); - return offset; - } - -@@ -4754,7 +4780,7 @@ static int dissect_UpdateError_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, pr - - - /*--- End of included file: packet-dap-fn.c ---*/ --#line 61 "./asn1/dap/packet-dap-template.c" -+#line 62 "./asn1/dap/packet-dap-template.c" - - - /*--- Included file: packet-dap-table11.c ---*/ -@@ -4786,7 +4812,7 @@ static const ros_opr_t dap_opr_tab[] = { - - - /*--- End of included file: packet-dap-table11.c ---*/ --#line 63 "./asn1/dap/packet-dap-template.c" -+#line 64 "./asn1/dap/packet-dap-template.c" - - /*--- Included file: packet-dap-table21.c ---*/ - #line 1 "./asn1/dap/packet-dap-table21.c" -@@ -4815,7 +4841,7 @@ static const ros_err_t dap_err_tab[] = { - - - /*--- End of included file: packet-dap-table21.c ---*/ --#line 64 "./asn1/dap/packet-dap-template.c" -+#line 65 "./asn1/dap/packet-dap-template.c" - - static const ros_info_t dap_ros_info = { - "DAP", -@@ -6455,7 +6481,7 @@ void proto_register_dap(void) { - NULL, HFILL }}, - - /*--- End of included file: packet-dap-hfarr.c ---*/ --#line 83 "./asn1/dap/packet-dap-template.c" -+#line 84 "./asn1/dap/packet-dap-template.c" - }; - - /* List of subtrees */ -@@ -6636,7 +6662,7 @@ void proto_register_dap(void) { - &ett_dap_T_signedUpdateError, - - /*--- End of included file: packet-dap-ettarr.c ---*/ --#line 89 "./asn1/dap/packet-dap-template.c" -+#line 90 "./asn1/dap/packet-dap-template.c" - }; - - static ei_register_info ei[] = { -diff --git a/epan/dissectors/packet-disp.c b/epan/dissectors/packet-disp.c -index 31ace80695f..e3c52719db6 100644 ---- a/epan/dissectors/packet-disp.c -+++ b/epan/dissectors/packet-disp.c -@@ -24,6 +24,7 @@ - #include - #include - #include -+#include - - #include "packet-ber.h" - #include "packet-acse.h" -@@ -165,7 +166,7 @@ static int hf_disp_signedShadowError = -1; /* T_signedShadowError */ - static int hf_disp_shadowError = -1; /* ShadowErrorData */ - - /*--- End of included file: packet-disp-hf.c ---*/ --#line 49 "./asn1/disp/packet-disp-template.c" -+#line 50 "./asn1/disp/packet-disp-template.c" - - /* Initialize the subtree pointers */ - static gint ett_disp = -1; -@@ -228,7 +229,7 @@ static gint ett_disp_ShadowError = -1; - static gint ett_disp_T_signedShadowError = -1; - - /*--- End of included file: packet-disp-ett.c ---*/ --#line 53 "./asn1/disp/packet-disp-template.c" -+#line 54 "./asn1/disp/packet-disp-template.c" - - static expert_field ei_disp_unsupported_opcode = EI_INIT; - static expert_field ei_disp_unsupported_errcode = EI_INIT; -@@ -249,6 +250,7 @@ static int dissect_disp_Subtree(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, in - static int dissect_disp_IncrementalStepRefresh(gboolean 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 -@@ -1066,9 +1068,15 @@ static const ber_sequence_t Subtree_sequence[] = { - - static int - dissect_disp_Subtree(gboolean 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); - 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); - return offset; - } - -@@ -1224,9 +1232,15 @@ static const ber_sequence_t IncrementalStepRefresh_sequence[] = { - - static int - dissect_disp_IncrementalStepRefresh(gboolean 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 = 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); - return offset; - } - -@@ -1467,7 +1481,7 @@ static int dissect_ShadowingAgreementInfo_PDU(tvbuff_t *tvb _U_, packet_info *pi - - - /*--- End of included file: packet-disp-fn.c ---*/ --#line 62 "./asn1/disp/packet-disp-template.c" -+#line 63 "./asn1/disp/packet-disp-template.c" - - /* - * Dissect DISP PDUs inside a ROS PDUs -@@ -2025,7 +2039,7 @@ void proto_register_disp(void) { - "ShadowErrorData", HFILL }}, - - /*--- End of included file: packet-disp-hfarr.c ---*/ --#line 187 "./asn1/disp/packet-disp-template.c" -+#line 188 "./asn1/disp/packet-disp-template.c" - }; - - /* List of subtrees */ -@@ -2090,7 +2104,7 @@ void proto_register_disp(void) { - &ett_disp_T_signedShadowError, - - /*--- End of included file: packet-disp-ettarr.c ---*/ --#line 193 "./asn1/disp/packet-disp-template.c" -+#line 194 "./asn1/disp/packet-disp-template.c" - }; - - static ei_register_info ei[] = { -@@ -2139,7 +2153,7 @@ void proto_reg_handoff_disp(void) { - - - /*--- End of included file: packet-disp-dis-tab.c ---*/ --#line 231 "./asn1/disp/packet-disp-template.c" -+#line 232 "./asn1/disp/packet-disp-template.c" - - /* APPLICATION CONTEXT */ - -diff --git a/epan/dissectors/packet-glow.c b/epan/dissectors/packet-glow.c -index 96792b432a9..3adc905fd75 100644 ---- a/epan/dissectors/packet-glow.c -+++ b/epan/dissectors/packet-glow.c -@@ -21,6 +21,7 @@ - # include "config.h" - - #include -+#include - #include "packet-ber.h" - - #define PNAME "Glow" -@@ -131,7 +132,7 @@ static int hf_glow_qualifiedFunction = -1; /* QualifiedFunction */ - static int hf_glow_qualifiedTemplate = -1; /* QualifiedTemplate */ - - /*--- End of included file: packet-glow-hf.c ---*/ --#line 28 "./asn1/glow/packet-glow-template.c" -+#line 29 "./asn1/glow/packet-glow-template.c" - - /* Initialize the subtree pointers */ - static int ett_glow = -1; -@@ -183,7 +184,7 @@ static gint ett_glow_SEQUENCE_OF_RootElement = -1; - static gint ett_glow_RootElement = -1; - - /*--- End of included file: packet-glow-ett.c ---*/ --#line 33 "./asn1/glow/packet-glow-template.c" -+#line 34 "./asn1/glow/packet-glow-template.c" - - - /*--- Included file: packet-glow-fn.c ---*/ -@@ -202,6 +203,7 @@ static int dissect_glow_ElementCollection(gboolean implicit_tag _U_, tvbuff_t *t - static int dissect_glow_Template(gboolean 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 -@@ -1102,9 +1104,15 @@ dissect_glow_SEQUENCE_OF_Element(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, i - - static int - dissect_glow_ElementCollection(gboolean 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); - 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); - return offset; - } - -@@ -1128,9 +1136,15 @@ dissect_glow_Parameter_U(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offse - - static int - dissect_glow_Parameter(gboolean 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); - 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); - return offset; - } - -@@ -1180,9 +1194,15 @@ dissect_glow_Template_U(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset - - static int - dissect_glow_Template(gboolean 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); - 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); - return offset; - } - -@@ -1492,7 +1512,7 @@ static int dissect_Root_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tre - - - /*--- End of included file: packet-glow-fn.c ---*/ --#line 35 "./asn1/glow/packet-glow-template.c" -+#line 36 "./asn1/glow/packet-glow-template.c" - - static int - dissect_glow(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) -@@ -1898,7 +1918,7 @@ void proto_register_glow(void) { - NULL, HFILL }}, - - /*--- End of included file: packet-glow-hfarr.c ---*/ --#line 60 "./asn1/glow/packet-glow-template.c" -+#line 61 "./asn1/glow/packet-glow-template.c" - }; - - /* List of subtrees */ -@@ -1951,7 +1971,7 @@ void proto_register_glow(void) { - &ett_glow_RootElement, - - /*--- End of included file: packet-glow-ettarr.c ---*/ --#line 66 "./asn1/glow/packet-glow-template.c" -+#line 67 "./asn1/glow/packet-glow-template.c" - }; - - -diff --git a/epan/dissectors/packet-goose.c b/epan/dissectors/packet-goose.c -index 9937af7314a..43b061e1fdb 100644 ---- a/epan/dissectors/packet-goose.c -+++ b/epan/dissectors/packet-goose.c -@@ -24,6 +24,7 @@ - - #include - #include -+#include - #include - #include - -@@ -158,7 +159,7 @@ static int hf_goose_mMSString = -1; /* MMSString */ - static int hf_goose_utc_time = -1; /* UtcTime */ - - /*--- End of included file: packet-goose-hf.c ---*/ --#line 90 "./asn1/goose/packet-goose-template.c" -+#line 91 "./asn1/goose/packet-goose-template.c" - - /* Initialize the subtree pointers */ - static int ett_r_goose = -1; -@@ -193,7 +194,7 @@ static gint ett_goose_SEQUENCE_OF_Data = -1; - static gint ett_goose_Data = -1; - - /*--- End of included file: packet-goose-ett.c ---*/ --#line 103 "./asn1/goose/packet-goose-template.c" -+#line 104 "./asn1/goose/packet-goose-template.c" - - - /*--- Included file: packet-goose-fn.c ---*/ -@@ -204,6 +205,7 @@ static gint ett_goose_Data = -1; - static int dissect_goose_Data(gboolean 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 -@@ -733,10 +735,16 @@ static const ber_choice_t Data_choice[] = { - - static int - dissect_goose_Data(gboolean 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); - 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); - return offset; - } - -@@ -783,7 +791,7 @@ dissect_goose_GOOSEpdu(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset - - - /*--- End of included file: packet-goose-fn.c ---*/ --#line 105 "./asn1/goose/packet-goose-template.c" -+#line 106 "./asn1/goose/packet-goose-template.c" - - static dissector_handle_t goose_handle = NULL; - static dissector_handle_t ositp_handle = NULL; -@@ -1485,7 +1493,7 @@ void proto_register_goose(void) { - "UtcTime", HFILL }}, - - /*--- End of included file: packet-goose-hfarr.c ---*/ --#line 566 "./asn1/goose/packet-goose-template.c" -+#line 567 "./asn1/goose/packet-goose-template.c" - }; - - /* List of subtrees */ -@@ -1521,7 +1529,7 @@ void proto_register_goose(void) { - &ett_goose_Data, - - /*--- End of included file: packet-goose-ettarr.c ---*/ --#line 580 "./asn1/goose/packet-goose-template.c" -+#line 581 "./asn1/goose/packet-goose-template.c" - }; - - static ei_register_info ei[] = { -diff --git a/epan/dissectors/packet-h225.c b/epan/dissectors/packet-h225.c -index 222aa4c9ea3..6c74e3d86e1 100644 ---- a/epan/dissectors/packet-h225.c -+++ b/epan/dissectors/packet-h225.c -@@ -1275,6 +1275,7 @@ 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 -@@ -4019,6 +4020,11 @@ 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); - #line 864 "./asn1/h225/h225.cnf" - gef_ctx_t *parent_gefx; - -@@ -4028,6 +4034,7 @@ 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); - #line 869 "./asn1/h225/h225.cnf" - actx->private_data = parent_gefx; - -@@ -4043,6 +4050,11 @@ 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); - #line 850 "./asn1/h225/h225.cnf" - void *priv_data = actx->private_data; - gef_ctx_t *gefx; -@@ -4057,6 +4069,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); - #line 860 "./asn1/h225/h225.cnf" - actx->private_data = priv_data; - -diff --git a/epan/dissectors/packet-h245.c b/epan/dissectors/packet-h245.c -index cb523c2f1d8..2990488283e 100644 ---- a/epan/dissectors/packet-h245.c -+++ b/epan/dissectors/packet-h245.c -@@ -36,6 +36,7 @@ - #include - #include - #include -+#include - #include - #include - #include "packet-tpkt.h" -@@ -202,7 +203,7 @@ typedef enum _IndicationMessage_enum { - } IndicationMessage_enum; - - /*--- End of included file: packet-h245-val.h ---*/ --#line 75 "./asn1/h245/packet-h245-template.c" -+#line 76 "./asn1/h245/packet-h245-template.c" - - static const value_string h245_RequestMessage_short_vals[] = { - { RequestMessage_nonStandard , "NSM" }, -@@ -1909,7 +1910,7 @@ static int hf_h245_encrypted = -1; /* OCTET_STRING */ - static int hf_h245_encryptedAlphanumeric = -1; /* EncryptedAlphanumeric */ - - /*--- End of included file: packet-h245-hf.c ---*/ --#line 375 "./asn1/h245/packet-h245-template.c" -+#line 376 "./asn1/h245/packet-h245-template.c" - - /* Initialize the subtree pointers */ - static int ett_h245 = -1; -@@ -2410,7 +2411,7 @@ static gint ett_h245_FlowControlIndication = -1; - static gint ett_h245_MobileMultilinkReconfigurationIndication = -1; - - /*--- End of included file: packet-h245-ett.c ---*/ --#line 380 "./asn1/h245/packet-h245-template.c" -+#line 381 "./asn1/h245/packet-h245-template.c" - - /* Forward declarations */ - static int dissect_h245_MultimediaSystemControlMessage(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_); -@@ -2449,6 +2450,7 @@ static int dissect_h245_AudioMode(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t - static int dissect_h245_ModeElementType(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 -@@ -3921,9 +3923,15 @@ static const per_sequence_t GenericParameter_sequence[] = { - - static int - dissect_h245_GenericParameter(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); - offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, - ett_h245_GenericParameter, GenericParameter_sequence); - -+ p_set_proto_depth(actx->pinfo, proto_id, recursion_depth - cycle_size); - return offset; - } - -@@ -5738,6 +5746,11 @@ static const per_choice_t VideoCapability_choice[] = { - - static int - dissect_h245_VideoCapability(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); - #line 457 "./asn1/h245/h245.cnf" - gint32 value; - -@@ -5749,6 +5762,7 @@ dissect_h245_VideoCapability(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx - - - -+ p_set_proto_depth(actx->pinfo, proto_id, recursion_depth - cycle_size); - return offset; - } - -@@ -6056,6 +6070,11 @@ static const per_choice_t AudioCapability_choice[] = { - - static int - dissect_h245_AudioCapability(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); - #line 450 "./asn1/h245/h245.cnf" - gint32 value; - -@@ -6066,6 +6085,7 @@ dissect_h245_AudioCapability(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx - codec_type = val_to_str(value, h245_AudioCapability_short_vals, ""); - - -+ p_set_proto_depth(actx->pinfo, proto_id, recursion_depth - cycle_size); - return offset; - } - -@@ -7236,6 +7256,11 @@ static const per_choice_t DataType_choice[] = { - - static int - dissect_h245_DataType(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 = 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); - #line 1007 "./asn1/h245/h245.cnf" - gint choice_index; - -@@ -7254,6 +7279,7 @@ if (upcoming_channel){ - - - -+ p_set_proto_depth(actx->pinfo, proto_id, recursion_depth - cycle_size); - return offset; - } - -@@ -9018,6 +9044,11 @@ static const per_sequence_t MultiplexElement_sequence[] = { - - static int - dissect_h245_MultiplexElement(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); - #line 82 "./asn1/h245/h245.cnf" - /*MultiplexElement*/ - h223_mux_element* me = wmem_new(wmem_file_scope(), h223_mux_element); -@@ -9028,6 +9059,7 @@ dissect_h245_MultiplexElement(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *act - offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, - ett_h245_MultiplexElement, MultiplexElement_sequence); - -+ p_set_proto_depth(actx->pinfo, proto_id, recursion_depth - cycle_size); - return offset; - } - -@@ -9655,6 +9687,11 @@ static const per_choice_t AudioMode_choice[] = { - - static int - dissect_h245_AudioMode(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); - #line 472 "./asn1/h245/h245.cnf" - gint32 value; - -@@ -9665,6 +9702,7 @@ dissect_h245_AudioMode(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, - codec_type = val_to_str(value, h245_AudioMode_vals, ""); - - -+ p_set_proto_depth(actx->pinfo, proto_id, recursion_depth - cycle_size); - return offset; - } - -@@ -10012,10 +10050,16 @@ static const per_choice_t ModeElementType_choice[] = { - - static int - dissect_h245_ModeElementType(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); - offset = dissect_per_choice(tvb, offset, actx, tree, hf_index, - ett_h245_ModeElementType, ModeElementType_choice, - NULL); - -+ p_set_proto_depth(actx->pinfo, proto_id, recursion_depth - cycle_size); - return offset; - } - -@@ -14497,7 +14541,7 @@ static int dissect_OpenLogicalChannel_PDU(tvbuff_t *tvb _U_, packet_info *pinfo - - - /*--- End of included file: packet-h245-fn.c ---*/ --#line 389 "./asn1/h245/packet-h245-template.c" -+#line 390 "./asn1/h245/packet-h245-template.c" - - static int - dissect_h245(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* data _U_) -@@ -20196,7 +20240,7 @@ void proto_register_h245(void) { - NULL, HFILL }}, - - /*--- End of included file: packet-h245-hfarr.c ---*/ --#line 475 "./asn1/h245/packet-h245-template.c" -+#line 476 "./asn1/h245/packet-h245-template.c" - }; - - /* List of subtrees */ -@@ -20699,7 +20743,7 @@ void proto_register_h245(void) { - &ett_h245_MobileMultilinkReconfigurationIndication, - - /*--- End of included file: packet-h245-ettarr.c ---*/ --#line 482 "./asn1/h245/packet-h245-template.c" -+#line 483 "./asn1/h245/packet-h245-template.c" - }; - module_t *h245_module; - -diff --git a/epan/dissectors/packet-h248.c b/epan/dissectors/packet-h248.c -index 32c11e5b4ff..57d33c4c044 100644 ---- a/epan/dissectors/packet-h248.c -+++ b/epan/dissectors/packet-h248.c -@@ -26,6 +26,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -392,7 +393,7 @@ static int hf_h248_NotifyCompletion_otherReason = -1; - static int hf_h248_NotifyCompletion_onIteration = -1; - - /*--- End of included file: packet-h248-hf.c ---*/ --#line 69 "./asn1/h248/packet-h248-template.c" -+#line 70 "./asn1/h248/packet-h248-template.c" - - /* Initialize the subtree pointers */ - static gint ett_h248 = -1; -@@ -560,7 +561,7 @@ static gint ett_h248_EventParameterV1 = -1; - static gint ett_h248_SigParameterV1 = -1; - - /*--- End of included file: packet-h248-ett.c ---*/ --#line 89 "./asn1/h248/packet-h248-template.c" -+#line 90 "./asn1/h248/packet-h248-template.c" - - static expert_field ei_h248_errored_command = EI_INIT; - static expert_field ei_h248_transactionId64 = EI_INIT; -@@ -2636,6 +2637,7 @@ static int dissect_h248_MtpAddress(gboolean implicit_tag, tvbuff_t *tvb, int off - static int dissect_h248_SecondEventsDescriptor(gboolean 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 -@@ -4292,9 +4294,15 @@ static const ber_sequence_t SecondEventsDescriptor_sequence[] = { - - static int - dissect_h248_SecondEventsDescriptor(gboolean 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 = 7; -+ 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, - SecondEventsDescriptor_sequence, hf_index, ett_h248_SecondEventsDescriptor); - -+ p_set_proto_depth(actx->pinfo, proto_id, recursion_depth - cycle_size); - return offset; - } - -@@ -6078,7 +6086,7 @@ dissect_h248_SigParameterV1(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int of - - - /*--- End of included file: packet-h248-fn.c ---*/ --#line 2156 "./asn1/h248/packet-h248-template.c" -+#line 2157 "./asn1/h248/packet-h248-template.c" - - static int dissect_h248_tpkt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) { - dissect_tpkt_encap(tvb, pinfo, tree, h248_desegment, h248_handle); -@@ -7503,7 +7511,7 @@ void proto_register_h248(void) { - NULL, HFILL }}, - - /*--- End of included file: packet-h248-hfarr.c ---*/ --#line 2324 "./asn1/h248/packet-h248-template.c" -+#line 2325 "./asn1/h248/packet-h248-template.c" - - GCP_HF_ARR_ELEMS("h248",h248_arrel) - -@@ -7669,7 +7677,7 @@ void proto_register_h248(void) { - &ett_h248_SigParameterV1, - - /*--- End of included file: packet-h248-ettarr.c ---*/ --#line 2342 "./asn1/h248/packet-h248-template.c" -+#line 2343 "./asn1/h248/packet-h248-template.c" - }; - - static ei_register_info ei[] = { -diff --git a/epan/dissectors/packet-ieee1609dot2.c b/epan/dissectors/packet-ieee1609dot2.c -index 031bf48bc53..a5d5e7051cb 100644 ---- a/epan/dissectors/packet-ieee1609dot2.c -+++ b/epan/dissectors/packet-ieee1609dot2.c -@@ -318,6 +318,7 @@ ieee1609dot2_set_next_default_psid(packet_info *pinfo, guint32 psid) - static int dissect_ieee1609dot2_SignedDataPayload(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 -@@ -2086,9 +2087,15 @@ static const oer_sequence_t SignedDataPayload_sequence[] = { - - static int - dissect_ieee1609dot2_SignedDataPayload(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); - offset = dissect_oer_sequence(tvb, offset, actx, tree, hf_index, - ett_ieee1609dot2_SignedDataPayload, SignedDataPayload_sequence); - -+ p_set_proto_depth(actx->pinfo, proto_id, recursion_depth - cycle_size); - return offset; - } - -diff --git a/epan/dissectors/packet-its.c b/epan/dissectors/packet-its.c -index 0b35d1516ac..de27694fc62 100644 ---- a/epan/dissectors/packet-its.c -+++ b/epan/dissectors/packet-its.c -@@ -1925,7 +1925,7 @@ static int hf_cpm_node_Z5 = -1; /* Offset_B14 */ - static int hf_cpm_node_Z6 = -1; /* Offset_B16 */ - - /*--- End of included file: packet-its-hf.c ---*/ --#line 288 "./asn1/its/packet-its-template.c" -+#line 289 "./asn1/its/packet-its-template.c" - - // CauseCode/SubCauseCode management - static int hf_its_trafficConditionSubCauseCode = -1; -@@ -2526,7 +2526,7 @@ static gint ett_cpm_OffsetPoint = -1; - static gint ett_cpm_NodeOffsetPointZ = -1; - - /*--- End of included file: packet-its-ett.c ---*/ --#line 318 "./asn1/its/packet-its-template.c" -+#line 319 "./asn1/its/packet-its-template.c" - - // Deal with cause/subcause code management - struct { CauseCodeType_enum cause; int* hf; } cause_to_subcause[] = { -@@ -11038,6 +11038,7 @@ static int dissect_AddGrpC_SignalStatusPackage_addGrpC_PDU(tvbuff_t *tvb _U_, pa - static int dissect_gdd_GddStructure(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 -@@ -11962,9 +11963,15 @@ static const per_sequence_t gdd_GddStructure_sequence[] = { - - static int - dissect_gdd_GddStructure(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); - offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index, - ett_gdd_GddStructure, gdd_GddStructure_sequence); - -+ p_set_proto_depth(actx->pinfo, proto_id, recursion_depth - cycle_size); - return offset; - } - -@@ -18561,7 +18568,7 @@ static int dissect_cpm_CollectivePerceptionMessage_PDU(tvbuff_t *tvb _U_, packet - - - /*--- End of included file: packet-its-fn.c ---*/ --#line 360 "./asn1/its/packet-its-template.c" -+#line 361 "./asn1/its/packet-its-template.c" - - static void - its_latitude_fmt(gchar *s, guint32 v) -@@ -25364,7 +25371,7 @@ void proto_register_its(void) - "Offset_B16", HFILL }}, - - /*--- End of included file: packet-its-hfarr.c ---*/ --#line 835 "./asn1/its/packet-its-template.c" -+#line 836 "./asn1/its/packet-its-template.c" - - { &hf_its_roadworksSubCauseCode, - { "roadworksSubCauseCode", "its.subCauseCode", -@@ -26138,7 +26145,7 @@ void proto_register_its(void) - &ett_cpm_NodeOffsetPointZ, - - /*--- End of included file: packet-its-ettarr.c ---*/ --#line 1038 "./asn1/its/packet-its-template.c" -+#line 1039 "./asn1/its/packet-its-template.c" - }; - - static ei_register_info ei[] = { -diff --git a/epan/dissectors/packet-ldap.c b/epan/dissectors/packet-ldap.c -index 33c7a31dba9..c9427e60311 100644 ---- a/epan/dissectors/packet-ldap.c -+++ b/epan/dissectors/packet-ldap.c -@@ -88,6 +88,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -336,7 +337,7 @@ static int hf_ldap_graceAuthNsRemaining = -1; /* INTEGER_0_maxInt */ - static int hf_ldap_error = -1; /* T_error */ - - /*--- End of included file: packet-ldap-hf.c ---*/ --#line 186 "./asn1/ldap/packet-ldap-template.c" -+#line 187 "./asn1/ldap/packet-ldap-template.c" - - /* Initialize the subtree pointers */ - static gint ett_ldap = -1; -@@ -408,7 +409,7 @@ static gint ett_ldap_PasswordPolicyResponseValue = -1; - static gint ett_ldap_T_warning = -1; - - /*--- End of included file: packet-ldap-ett.c ---*/ --#line 198 "./asn1/ldap/packet-ldap-template.c" -+#line 199 "./asn1/ldap/packet-ldap-template.c" - - static expert_field ei_ldap_exceeded_filter_length = EI_INIT; - static expert_field ei_ldap_too_many_filter_elements = EI_INIT; -@@ -1130,6 +1131,7 @@ ldap_match_call_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gu - static int dissect_ldap_Filter(gboolean 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 -@@ -2246,6 +2248,11 @@ static const ber_choice_t Filter_choice[] = { - - static int - dissect_ldap_Filter(gboolean 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 = 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); - #line 661 "./asn1/ldap/ldap.cnf" - proto_tree *tr; - proto_item *it; -@@ -2273,6 +2280,7 @@ dissect_ldap_Filter(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_ - - - -+ p_set_proto_depth(actx->pinfo, proto_id, recursion_depth - cycle_size); - return offset; - } - -@@ -3815,7 +3823,7 @@ static int dissect_PasswordPolicyResponseValue_PDU(tvbuff_t *tvb _U_, packet_inf - - - /*--- End of included file: packet-ldap-fn.c ---*/ --#line 909 "./asn1/ldap/packet-ldap-template.c" -+#line 910 "./asn1/ldap/packet-ldap-template.c" - static int dissect_LDAPMessage_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, ldap_conv_info_t *ldap_info) { - - int offset = 0; -@@ -5632,7 +5640,7 @@ void proto_register_ldap(void) { - NULL, HFILL }}, - - /*--- End of included file: packet-ldap-hfarr.c ---*/ --#line 2157 "./asn1/ldap/packet-ldap-template.c" -+#line 2158 "./asn1/ldap/packet-ldap-template.c" - }; - - /* List of subtrees */ -@@ -5706,7 +5714,7 @@ void proto_register_ldap(void) { - &ett_ldap_T_warning, - - /*--- End of included file: packet-ldap-ettarr.c ---*/ --#line 2171 "./asn1/ldap/packet-ldap-template.c" -+#line 2172 "./asn1/ldap/packet-ldap-template.c" - }; - /* UAT for header fields */ - static uat_field_t custom_attribute_types_uat_fields[] = { -@@ -5917,7 +5925,7 @@ proto_reg_handoff_ldap(void) - - - /*--- End of included file: packet-ldap-dis-tab.c ---*/ --#line 2365 "./asn1/ldap/packet-ldap-template.c" -+#line 2366 "./asn1/ldap/packet-ldap-template.c" - - dissector_add_uint_range_with_preference("tcp.port", TCP_PORT_RANGE_LDAP, ldap_handle); - -diff --git a/epan/dissectors/packet-mms.c b/epan/dissectors/packet-mms.c -index 233bbb835c6..e7cbeb7aeae 100644 ---- a/epan/dissectors/packet-mms.c -+++ b/epan/dissectors/packet-mms.c -@@ -1057,6 +1057,7 @@ static int dissect_mms_AlternateAccess(gboolean implicit_tag _U_, tvbuff_t *tvb - static int dissect_mms_Data(gboolean 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 -@@ -1578,10 +1579,16 @@ static const ber_choice_t TypeSpecification_choice[] = { - - static int - dissect_mms_TypeSpecification(gboolean 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); - offset = dissect_ber_choice(actx, tree, tvb, offset, - TypeSpecification_choice, hf_index, ett_mms_TypeSpecification, - NULL); - -+ p_set_proto_depth(actx->pinfo, proto_id, recursion_depth - cycle_size); - return offset; - } - -@@ -1763,9 +1770,15 @@ static const ber_sequence_t AlternateAccess_sequence_of[1] = { - - static int - dissect_mms_AlternateAccess(gboolean 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 = 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_of(implicit_tag, actx, tree, tvb, offset, - AlternateAccess_sequence_of, hf_index, ett_mms_AlternateAccess); - -+ p_set_proto_depth(actx->pinfo, proto_id, recursion_depth - cycle_size); - return offset; - } - -@@ -1819,10 +1832,16 @@ static const ber_choice_t VariableSpecification_choice[] = { - - static int - dissect_mms_VariableSpecification(gboolean 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 = 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, - VariableSpecification_choice, hf_index, ett_mms_VariableSpecification, - NULL); - -+ p_set_proto_depth(actx->pinfo, proto_id, recursion_depth - cycle_size); - return offset; - } - -@@ -2108,10 +2127,16 @@ static const ber_choice_t Data_choice[] = { - - static int - dissect_mms_Data(gboolean 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); - offset = dissect_ber_choice(actx, tree, tvb, offset, - Data_choice, hf_index, ett_mms_Data, - NULL); - -+ p_set_proto_depth(actx->pinfo, proto_id, recursion_depth - cycle_size); - return offset; - } - -diff --git a/epan/dissectors/packet-p22.c b/epan/dissectors/packet-p22.c -index f446ab88f4c..fb9aeb29c95 100644 ---- a/epan/dissectors/packet-p22.c -+++ b/epan/dissectors/packet-p22.c -@@ -22,6 +22,7 @@ - #include - #include - #include -+#include - - #include "packet-ber.h" - #include "packet-acse.h" -@@ -323,7 +324,7 @@ static const value_string charsetreg_vals [] = { - #define ub_telephone_number 32 - - /*--- End of included file: packet-p22-val.h ---*/ --#line 67 "./asn1/p22/packet-p22-template.c" -+#line 68 "./asn1/p22/packet-p22-template.c" - - - /*--- Included file: packet-p22-hf.c ---*/ -@@ -708,7 +709,7 @@ static int hf_p22_RecipientSecurityRequest_ipn_non_repudiation = -1; - static int hf_p22_RecipientSecurityRequest_ipn_proof = -1; - - /*--- End of included file: packet-p22-hf.c ---*/ --#line 69 "./asn1/p22/packet-p22-template.c" -+#line 70 "./asn1/p22/packet-p22-template.c" - - /* Initialize the subtree pointers */ - static gint ett_p22 = -1; -@@ -842,7 +843,7 @@ static gint ett_p22_T_body_part_token_choice = -1; - static gint ett_p22_T_choice = -1; - - /*--- End of included file: packet-p22-ett.c ---*/ --#line 73 "./asn1/p22/packet-p22-template.c" -+#line 74 "./asn1/p22/packet-p22-template.c" - - - /*--- Included file: packet-p22-fn.c ---*/ -@@ -862,6 +863,7 @@ static int dissect_p22_BodyPartTokens(gboolean implicit_tag _U_, tvbuff_t *tvb _ - static int dissect_p22_ForwardedContentToken(gboolean 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 -@@ -1834,6 +1836,11 @@ static const ber_sequence_t IPM_sequence[] = { - - int - dissect_p22_IPM(gboolean 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 = 7; -+ 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); - #line 243 "./asn1/p22/p22.cnf" - - col_append_str(actx->pinfo->cinfo, COL_INFO, " Message"); -@@ -1845,6 +1852,7 @@ dissect_p22_IPM(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, as - - - -+ p_set_proto_depth(actx->pinfo, proto_id, recursion_depth - cycle_size); - return offset; - } - -@@ -3557,9 +3565,15 @@ static const ber_sequence_t IPMSynopsis_sequence_of[1] = { - - static int - dissect_p22_IPMSynopsis(gboolean 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 = 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_of(implicit_tag, actx, tree, tvb, offset, - IPMSynopsis_sequence_of, hf_index, ett_p22_IPMSynopsis); - -+ p_set_proto_depth(actx->pinfo, proto_id, recursion_depth - cycle_size); - return offset; - } - -@@ -4017,9 +4031,15 @@ static const ber_sequence_t BodyPartTokens_set_of[1] = { - - static int - dissect_p22_BodyPartTokens(gboolean 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 = 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_set_of(implicit_tag, actx, tree, tvb, offset, - BodyPartTokens_set_of, hf_index, ett_p22_BodyPartTokens); - -+ p_set_proto_depth(actx->pinfo, proto_id, recursion_depth - cycle_size); - return offset; - } - -@@ -4067,9 +4087,15 @@ static const ber_sequence_t ForwardedContentToken_set_of[1] = { - - static int - dissect_p22_ForwardedContentToken(gboolean 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 = 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_set_of(implicit_tag, actx, tree, tvb, offset, - ForwardedContentToken_set_of, hf_index, ett_p22_ForwardedContentToken); - -+ p_set_proto_depth(actx->pinfo, proto_id, recursion_depth - cycle_size); - return offset; - } - -@@ -4659,7 +4685,7 @@ static int dissect_ForwardedContentToken_PDU(tvbuff_t *tvb _U_, packet_info *pin - - - /*--- End of included file: packet-p22-fn.c ---*/ --#line 75 "./asn1/p22/packet-p22-template.c" -+#line 76 "./asn1/p22/packet-p22-template.c" - - /* - * Dissect P22 PDUs inside a PPDU. -@@ -6205,7 +6231,7 @@ void proto_register_p22(void) { - NULL, HFILL }}, - - /*--- End of included file: packet-p22-hfarr.c ---*/ --#line 108 "./asn1/p22/packet-p22-template.c" -+#line 109 "./asn1/p22/packet-p22-template.c" - }; - - /* List of subtrees */ -@@ -6341,7 +6367,7 @@ void proto_register_p22(void) { - &ett_p22_T_choice, - - /*--- End of included file: packet-p22-ettarr.c ---*/ --#line 114 "./asn1/p22/packet-p22-template.c" -+#line 115 "./asn1/p22/packet-p22-template.c" - }; - - /* Register protocol */ -@@ -6461,7 +6487,7 @@ void proto_reg_handoff_p22(void) { - - - /*--- End of included file: packet-p22-dis-tab.c ---*/ --#line 130 "./asn1/p22/packet-p22-template.c" -+#line 131 "./asn1/p22/packet-p22-template.c" - - register_ber_oid_dissector("2.6.1.10.0", dissect_p22, proto_p22, "InterPersonal Message (1984)"); - register_ber_oid_dissector("2.6.1.10.1", dissect_p22, proto_p22, "InterPersonal Message (1988)"); -diff --git a/epan/dissectors/packet-p7.c b/epan/dissectors/packet-p7.c -index e9c24366e03..64bd635486a 100644 ---- a/epan/dissectors/packet-p7.c -+++ b/epan/dissectors/packet-p7.c -@@ -23,6 +23,7 @@ - #include - #include - #include -+#include - - #include "packet-ber.h" - #include "packet-acse.h" -@@ -104,7 +105,7 @@ static int proto_p7 = -1; - #define ub_ua_restrictions 16 - - /*--- End of included file: packet-p7-val.h ---*/ --#line 41 "./asn1/p7/packet-p7-template.c" -+#line 42 "./asn1/p7/packet-p7-template.c" - - - /*--- Included file: packet-p7-hf.c ---*/ -@@ -476,7 +477,7 @@ static int hf_p7_T_entry_class_problem_entry_class_not_subscribed = -1; - static int hf_p7_T_entry_class_problem_inappropriate_entry_class = -1; - - /*--- End of included file: packet-p7-hf.c ---*/ --#line 43 "./asn1/p7/packet-p7-template.c" -+#line 44 "./asn1/p7/packet-p7-template.c" - - /* Initialize the subtree pointers */ - static gint ett_p7 = -1; -@@ -618,7 +619,7 @@ static gint ett_p7_RTSE_apdus = -1; - static gint ett_p7_RTABapdu = -1; - - /*--- End of included file: packet-p7-ett.c ---*/ --#line 47 "./asn1/p7/packet-p7-template.c" -+#line 48 "./asn1/p7/packet-p7-template.c" - - - /*--- Included file: packet-p7-table.c ---*/ -@@ -661,7 +662,7 @@ static const value_string p7_err_code_string_vals[] = { - - - /*--- End of included file: packet-p7-table.c ---*/ --#line 49 "./asn1/p7/packet-p7-template.c" -+#line 50 "./asn1/p7/packet-p7-template.c" - - - /*--- Included file: packet-p7-fn.c ---*/ -@@ -673,6 +674,7 @@ static const value_string p7_err_code_string_vals[] = { - static int dissect_p7_Filter(gboolean 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 -@@ -1587,10 +1589,16 @@ static const ber_choice_t Filter_choice[] = { - - static int - dissect_p7_Filter(gboolean 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); - offset = dissect_ber_choice(actx, tree, tvb, offset, - Filter_choice, hf_index, ett_p7_Filter, - NULL); - -+ p_set_proto_depth(actx->pinfo, proto_id, recursion_depth - cycle_size); - return offset; - } - -@@ -4106,7 +4114,7 @@ static int dissect_RTSE_apdus_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, pro - - - /*--- End of included file: packet-p7-fn.c ---*/ --#line 51 "./asn1/p7/packet-p7-template.c" -+#line 52 "./asn1/p7/packet-p7-template.c" - - - /*--- Included file: packet-p7-table11.c ---*/ -@@ -4138,7 +4146,7 @@ static const ros_opr_t p7_opr_tab[] = { - - - /*--- End of included file: packet-p7-table11.c ---*/ --#line 53 "./asn1/p7/packet-p7-template.c" -+#line 54 "./asn1/p7/packet-p7-template.c" - - /*--- Included file: packet-p7-table21.c ---*/ - #line 1 "./asn1/p7/packet-p7-table21.c" -@@ -4177,7 +4185,7 @@ static const ros_err_t p7_err_tab[] = { - - - /*--- End of included file: packet-p7-table21.c ---*/ --#line 54 "./asn1/p7/packet-p7-template.c" -+#line 55 "./asn1/p7/packet-p7-template.c" - - static const ros_info_t p7_ros_info = { - "P7", -@@ -5657,7 +5665,7 @@ void proto_register_p7(void) { - NULL, HFILL }}, - - /*--- End of included file: packet-p7-hfarr.c ---*/ --#line 73 "./asn1/p7/packet-p7-template.c" -+#line 74 "./asn1/p7/packet-p7-template.c" - }; - - /* List of subtrees */ -@@ -5801,7 +5809,7 @@ void proto_register_p7(void) { - &ett_p7_RTABapdu, - - /*--- End of included file: packet-p7-ettarr.c ---*/ --#line 79 "./asn1/p7/packet-p7-template.c" -+#line 80 "./asn1/p7/packet-p7-template.c" - }; - module_t *p7_module; - -@@ -5860,7 +5868,7 @@ void proto_reg_handoff_p7(void) { - - - /*--- End of included file: packet-p7-dis-tab.c ---*/ --#line 105 "./asn1/p7/packet-p7-template.c" -+#line 106 "./asn1/p7/packet-p7-template.c" - - /* APPLICATION CONTEXT */ - -diff --git a/epan/dissectors/packet-sv.c b/epan/dissectors/packet-sv.c -index 88caa0fbc62..ab5e8b30b5a 100644 ---- a/epan/dissectors/packet-sv.c -+++ b/epan/dissectors/packet-sv.c -@@ -118,7 +118,7 @@ static int hf_sv_smpMod = -1; /* T_smpMod */ - static int hf_sv_gmidData = -1; /* GmidData */ - - /*--- End of included file: packet-sv-hf.c ---*/ --#line 94 "./asn1/sv/packet-sv-template.c" -+#line 95 "./asn1/sv/packet-sv-template.c" - - /* Initialize the subtree pointers */ - static int ett_sv = -1; -@@ -137,7 +137,7 @@ static gint ett_sv_SEQUENCE_OF_ASDU = -1; - static gint ett_sv_ASDU = -1; - - /*--- End of included file: packet-sv-ett.c ---*/ --#line 104 "./asn1/sv/packet-sv-template.c" -+#line 105 "./asn1/sv/packet-sv-template.c" - - static expert_field ei_sv_mal_utctime = EI_INIT; - static expert_field ei_sv_zero_pdu = EI_INIT; -@@ -491,7 +491,7 @@ dissect_sv_SampledValues(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offse - - - /*--- End of included file: packet-sv-fn.c ---*/ --#line 187 "./asn1/sv/packet-sv-template.c" -+#line 199 "./asn1/sv/packet-sv-template.c" - - /* - * Dissect SV PDUs inside a PPDU. -@@ -684,7 +684,7 @@ void proto_register_sv(void) { - NULL, HFILL }}, - - /*--- End of included file: packet-sv-hfarr.c ---*/ --#line 319 "./asn1/sv/packet-sv-template.c" -+#line 331 "./asn1/sv/packet-sv-template.c" - }; - - /* List of subtrees */ -@@ -703,7 +703,7 @@ void proto_register_sv(void) { - &ett_sv_ASDU, - - /*--- End of included file: packet-sv-ettarr.c ---*/ --#line 329 "./asn1/sv/packet-sv-template.c" -+#line 341 "./asn1/sv/packet-sv-template.c" - }; - - static ei_register_info ei[] = { -diff --git a/epan/dissectors/packet-x509if.c b/epan/dissectors/packet-x509if.c -index 50320220a0e..65c3c1ac7e6 100644 ---- a/epan/dissectors/packet-x509if.c -+++ b/epan/dissectors/packet-x509if.c -@@ -22,6 +22,7 @@ - #include - #include - #include -+#include - #include - - #include "packet-ber.h" -@@ -201,7 +202,7 @@ static int hf_x509if_AllowedSubset_oneLevel = -1; - static int hf_x509if_AllowedSubset_wholeSubtree = -1; - - /*--- End of included file: packet-x509if-hf.c ---*/ --#line 37 "./asn1/x509if/packet-x509if-template.c" -+#line 38 "./asn1/x509if/packet-x509if-template.c" - - /* Initialize the subtree pointers */ - -@@ -282,7 +283,7 @@ static gint ett_x509if_SEQUENCE_SIZE_1_MAX_OF_AttributeType = -1; - static gint ett_x509if_SET_SIZE_1_MAX_OF_DirectoryString = -1; - - /*--- End of included file: packet-x509if-ett.c ---*/ --#line 40 "./asn1/x509if/packet-x509if-template.c" -+#line 41 "./asn1/x509if/packet-x509if-template.c" - - static proto_tree *top_of_dn = NULL; - static proto_tree *top_of_rdn = NULL; -@@ -336,6 +337,7 @@ x509if_frame_end(void) - /*int dissect_x509if_AttributeCombination(gboolean 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 -@@ -1096,10 +1098,16 @@ static const ber_choice_t Refinement_choice[] = { - - int - dissect_x509if_Refinement(gboolean 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); - 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); - return offset; - } - -@@ -1541,10 +1549,16 @@ static const ber_choice_t ContextCombination_choice[] = { - - int - dissect_x509if_ContextCombination(gboolean 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); - 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); - return offset; - } - -@@ -1662,10 +1676,16 @@ static const ber_choice_t AttributeCombination_choice[] = { - - int - dissect_x509if_AttributeCombination(gboolean 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); - 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); - return offset; - } - -@@ -2090,7 +2110,7 @@ static int dissect_HierarchyBelow_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, - - - /*--- End of included file: packet-x509if-fn.c ---*/ --#line 76 "./asn1/x509if/packet-x509if-template.c" -+#line 77 "./asn1/x509if/packet-x509if-template.c" - - const char * x509if_get_last_dn(void) - { -@@ -2756,7 +2776,7 @@ void proto_register_x509if(void) { - NULL, HFILL }}, - - /*--- End of included file: packet-x509if-hfarr.c ---*/ --#line 121 "./asn1/x509if/packet-x509if-template.c" -+#line 122 "./asn1/x509if/packet-x509if-template.c" - }; - - /* List of subtrees */ -@@ -2839,7 +2859,7 @@ void proto_register_x509if(void) { - &ett_x509if_SET_SIZE_1_MAX_OF_DirectoryString, - - /*--- End of included file: packet-x509if-ettarr.c ---*/ --#line 126 "./asn1/x509if/packet-x509if-template.c" -+#line 127 "./asn1/x509if/packet-x509if-template.c" - }; - - /* Register protocol */ -@@ -2897,6 +2917,6 @@ void proto_reg_handoff_x509if(void) { - - - /*--- End of included file: packet-x509if-dis-tab.c ---*/ --#line 145 "./asn1/x509if/packet-x509if-template.c" -+#line 146 "./asn1/x509if/packet-x509if-template.c" - } - -diff --git a/epan/dissectors/packet-x509sat.c b/epan/dissectors/packet-x509sat.c -index 876b9831ca3..8c533081847 100644 ---- a/epan/dissectors/packet-x509sat.c -+++ b/epan/dissectors/packet-x509sat.c -@@ -22,6 +22,7 @@ - #include - #include - #include -+#include - - #include "packet-ber.h" - #include "packet-p1.h" -@@ -207,7 +208,7 @@ static int hf_x509sat_T_bitNamedDays_friday = -1; - static int hf_x509sat_T_bitNamedDays_saturday = -1; - - /*--- End of included file: packet-x509sat-hf.c ---*/ --#line 33 "./asn1/x509sat/packet-x509sat-template.c" -+#line 34 "./asn1/x509sat/packet-x509sat-template.c" - - /* Initialize the subtree pointers */ - -@@ -262,7 +263,7 @@ static gint ett_x509sat_T_between = -1; - static gint ett_x509sat_LocaleContextSyntax = -1; - - /*--- End of included file: packet-x509sat-ett.c ---*/ --#line 36 "./asn1/x509sat/packet-x509sat-template.c" -+#line 37 "./asn1/x509sat/packet-x509sat-template.c" - - - /*--- Included file: packet-x509sat-fn.c ---*/ -@@ -274,6 +275,7 @@ static gint ett_x509sat_LocaleContextSyntax = -1; - /*int dissect_x509sat_Criteria(gboolean 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 -@@ -448,10 +450,16 @@ static const ber_choice_t Criteria_choice[] = { - - int - dissect_x509sat_Criteria(gboolean 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); - offset = dissect_ber_choice(actx, tree, tvb, offset, - Criteria_choice, hf_index, ett_x509sat_Criteria, - NULL); - -+ p_set_proto_depth(actx->pinfo, proto_id, recursion_depth - cycle_size); - return offset; - } - -@@ -1906,7 +1914,7 @@ static int dissect_GUID_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tre - - - /*--- End of included file: packet-x509sat-fn.c ---*/ --#line 38 "./asn1/x509sat/packet-x509sat-template.c" -+#line 39 "./asn1/x509sat/packet-x509sat-template.c" - - - /*--- proto_register_x509sat ----------------------------------------------*/ -@@ -2575,7 +2583,7 @@ void proto_register_x509sat(void) { - NULL, HFILL }}, - - /*--- End of included file: packet-x509sat-hfarr.c ---*/ --#line 46 "./asn1/x509sat/packet-x509sat-template.c" -+#line 47 "./asn1/x509sat/packet-x509sat-template.c" - }; - - /* List of subtrees */ -@@ -2632,7 +2640,7 @@ void proto_register_x509sat(void) { - &ett_x509sat_LocaleContextSyntax, - - /*--- End of included file: packet-x509sat-ettarr.c ---*/ --#line 51 "./asn1/x509sat/packet-x509sat-template.c" -+#line 52 "./asn1/x509sat/packet-x509sat-template.c" - }; - - /* Register protocol */ -@@ -2685,7 +2693,7 @@ void proto_register_x509sat(void) { - register_ber_syntax_dissector("X121Address", proto_x509sat, dissect_X121Address_PDU); - - /*--- End of included file: packet-x509sat-syn-reg.c ---*/ --#line 61 "./asn1/x509sat/packet-x509sat-template.c" -+#line 62 "./asn1/x509sat/packet-x509sat-template.c" - - } - -@@ -2878,7 +2886,7 @@ void proto_reg_handoff_x509sat(void) { - - - /*--- End of included file: packet-x509sat-dis-tab.c ---*/ --#line 68 "./asn1/x509sat/packet-x509sat-template.c" -+#line 69 "./asn1/x509sat/packet-x509sat-template.c" - - /* OBJECT CLASSES */ - -diff --git a/epan/dissectors/packet-z3950.c b/epan/dissectors/packet-z3950.c -index 3ad54b0ee10..e25a2e7c1e8 100644 ---- a/epan/dissectors/packet-z3950.c -+++ b/epan/dissectors/packet-z3950.c -@@ -2088,6 +2088,7 @@ static int dissect_z3950_ElementInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U - static int dissect_z3950_TaggedElement(gboolean 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 -@@ -3067,10 +3068,16 @@ static const ber_choice_t RPNStructure_choice[] = { - - static int - dissect_z3950_RPNStructure(gboolean 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); - offset = dissect_ber_choice(actx, tree, tvb, offset, - RPNStructure_choice, hf_index, ett_z3950_RPNStructure, - NULL); - -+ p_set_proto_depth(actx->pinfo, proto_id, recursion_depth - cycle_size); - return offset; - } - -@@ -6584,9 +6591,15 @@ static const ber_sequence_t ElementInfo_sequence[] = { - - static int - dissect_z3950_ElementInfo(gboolean 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 = 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, - ElementInfo_sequence, hf_index, ett_z3950_ElementInfo); - -+ p_set_proto_depth(actx->pinfo, proto_id, recursion_depth - cycle_size); - return offset; - } - -@@ -8059,9 +8072,15 @@ static const ber_sequence_t TaggedElement_sequence[] = { - - static int - dissect_z3950_TaggedElement(gboolean 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 = 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, - TaggedElement_sequence, hf_index, ett_z3950_TaggedElement); - -+ p_set_proto_depth(actx->pinfo, proto_id, recursion_depth - cycle_size); - return offset; - } - -diff --git a/tools/asn2wrs.py b/tools/asn2wrs.py -index db199b6a253..9f50738a3b4 100755 ---- a/tools/asn2wrs.py -+++ b/tools/asn2wrs.py -@@ -1548,6 +1548,23 @@ class EthCtx: - if self.conform.check_item('PDU', tname): - out += self.output_proto_root() - -+ cycle_size = 0 -+ if self.eth_dep_cycle: -+ for cur_cycle in self.eth_dep_cycle: -+ t = self.type[cur_cycle[0]]['ethname'] -+ if t == tname: -+ cycle_size = len(cur_cycle) -+ break -+ -+ if cycle_size > 0: -+ out += f'''\ -+ const int proto_id = GPOINTER_TO_INT(wmem_list_frame_data(wmem_list_tail(actx->pinfo->layers))); -+ const unsigned cycle_size = {cycle_size}; -+ 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); -+''' -+ - if self.conform.get_fn_presence(self.eth_type[tname]['ref'][0]): - out += self.conform.get_fn_text(self.eth_type[tname]['ref'][0], 'FN_HDR') - return out -@@ -1558,6 +1575,20 @@ class EthCtx: - #if self.conform.get_fn_presence(tname): - # out += self.conform.get_fn_text(tname, 'FN_FTR') - #el -+ -+ add_recursion_check = False -+ if self.eth_dep_cycle: -+ for cur_cycle in self.eth_dep_cycle: -+ t = self.type[cur_cycle[0]]['ethname'] -+ if t == tname: -+ add_recursion_check = True -+ break -+ -+ if add_recursion_check: -+ out += '''\ -+ p_set_proto_depth(actx->pinfo, proto_id, recursion_depth - cycle_size); -+''' -+ - if self.conform.get_fn_presence(self.eth_type[tname]['ref'][0]): - out += self.conform.get_fn_text(self.eth_type[tname]['ref'][0], 'FN_FTR') - out += " return offset;\n" -@@ -1825,12 +1856,15 @@ class EthCtx: - fx.write(self.eth_out_pdu_decl(f)) - if not first_decl: - fx.write('\n') -+ -+ add_depth_define = False - if self.eth_dep_cycle: - fx.write('/*--- Cyclic dependencies ---*/\n\n') - i = 0 - while i < len(self.eth_dep_cycle): - t = self.type[self.eth_dep_cycle[i][0]]['ethname'] - if self.dep_cycle_eth_type[t][0] != i: i += 1; continue -+ add_depth_define = True - fx.write(''.join(['/* %s */\n' % ' -> '.join(self.eth_dep_cycle[i]) for i in self.dep_cycle_eth_type[t]])) - if not self.eth_type[t]['export'] & EF_TYPE: - fx.write(self.eth_type_fn_h(t)) -@@ -1839,6 +1873,8 @@ class EthCtx: - fx.write('\n') - i += 1 - fx.write('\n') -+ if add_depth_define: -+ fx.write('#define MAX_RECURSION_DEPTH 100 // Arbitrarily chosen.\n') - for t in self.eth_type_ord1: - if self.eth_type[t]['import']: - continue --- -GitLab - diff --git a/Fix-libvirt-build-fail.patch b/Fix-libvirt-build-fail.patch deleted file mode 100644 index 84c42044070775cffbafa0fc7986065cae174aa4..0000000000000000000000000000000000000000 --- a/Fix-libvirt-build-fail.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff --git a/wireshark.pc.in b/wireshark.pc.in -index 5889178..e755614 100644 ---- a/wireshark.pc.in -+++ b/wireshark.pc.in -@@ -10,5 +10,5 @@ Description: Network Packet Dissection Library - Version: @VERSION@ - - Requires: glib-2.0, gmodule-2.0, gthread-2.0 --Libs: -L${libdir} -lwireshark -+Libs: -L${libdir} -lwireshark -lwsutil - Cflags: -I${includedir}/wireshark diff --git a/SIGNATURES-3.6.14.txt b/SIGNATURES-3.6.14.txt deleted file mode 100644 index 2cae2909aed6cce50245238a0a2e0c6b1fe80c51..0000000000000000000000000000000000000000 Binary files a/SIGNATURES-3.6.14.txt and /dev/null differ diff --git a/SIGNATURES-4.2.4.txt b/SIGNATURES-4.2.4.txt new file mode 100644 index 0000000000000000000000000000000000000000..b8cfa90e0857e43d806136c640502fb3cbe12159 --- /dev/null +++ b/SIGNATURES-4.2.4.txt @@ -0,0 +1,53 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA512 + +wireshark-4.2.4.tar.xz: 44986232 bytes +SHA256(wireshark-4.2.4.tar.xz)=46bd0f4474337144b30816fb2d8f14e72a26d0391f24fe0b7b619acdcdad8c0c +SHA1(wireshark-4.2.4.tar.xz)=a9979b052652c69d3ca308fb1f2d369b820bb007 + +Wireshark-4.2.4-x64.exe: 86455240 bytes +SHA256(Wireshark-4.2.4-x64.exe)=b621718ffe64748590ea9568fbbed0f3d86b0939906dc9f7fe064e20ce385492 +SHA1(Wireshark-4.2.4-x64.exe)=caa0849461201937fa995afc5d2b80986c506891 + +Wireshark-4.2.4-arm64.exe: 67927072 bytes +SHA256(Wireshark-4.2.4-arm64.exe)=f6f94f8628d1d4f830c79ee4a9962c36b4497a6219c7ca9e3527c48a0f424eac +SHA1(Wireshark-4.2.4-arm64.exe)=5880810dd02c68c00454f29747e560b9b68989d7 + +Wireshark-4.2.4-x64.msi: 62881792 bytes +SHA256(Wireshark-4.2.4-x64.msi)=2449ca54220cf3c4e66c49c136762cf8b944713fbd488e5fd76c79fba36e4a7e +SHA1(Wireshark-4.2.4-x64.msi)=f2c3238283c09b3c55be2865526aa678d09cda39 + +WiresharkPortable64_4.2.4.paf.exe: 53606272 bytes +SHA256(WiresharkPortable64_4.2.4.paf.exe)=f949f0cc98d1201a233913ce9cd5007bddf7980722ac0835bddfaa3e750d3b8c +SHA1(WiresharkPortable64_4.2.4.paf.exe)=80a1e625eed7ac2b25b0171beb14c5a95d6288a2 + +Wireshark 4.2.4 Arm 64.dmg: 65626764 bytes +SHA256(Wireshark 4.2.4 Arm 64.dmg)=93c874a00c3f436bb0a234dd170e30fb3a966736aea7590013e48a1eeb612a01 +SHA1(Wireshark 4.2.4 Arm 64.dmg)=531b786e90bc3b119d442e6bcf34f4f7f44151a3 + +Wireshark 4.2.4 Intel 64.dmg: 69408431 bytes +SHA256(Wireshark 4.2.4 Intel 64.dmg)=00f6f08652263d4a93249ff1ba8fdff28de16806184d9d26e0dba1ab8b9ed604 +SHA1(Wireshark 4.2.4 Intel 64.dmg)=ea887db33f1a8f8af0db3c2ca7380844b5a68b26 + +You can validate these hashes using the following commands (among others): + + Windows: certutil -hashfile Wireshark-win64-x.y.z.exe SHA256 + Linux (GNU Coreutils): sha256sum wireshark-x.y.z.tar.xz + macOS: shasum -a 256 "Wireshark x.y.z Arm 64.dmg" + Other: openssl sha256 wireshark-x.y.z.tar.xz +-----BEGIN PGP SIGNATURE----- + +iQIzBAEBCgAdFiEEWlrbp9vqbD+HIk8ZgiRKeOb+ruoFAmYEi88ACgkQgiRKeOb+ +ruog5A/5AbZMbwCZjByuJSeGiayetH/tjKIey4iLnGluGuvmKsKmxyqtkL/PwUEd +slEpp+RjSDAONkbxDsFTebXYk2nUqy0wsMAk5NFXxCodIShN5hzAfvKWiGe7fJ5g +0kIMxO1b2Zn/JSzb3BBfENjHSF51NjxB0syIh3Q+avqkizl6Tjeq7uP+BtGAFWVf +gXZL9zIRS6BvDImcGJwq/TJaZ9hLWWENzohp9kcCPsavbrqxCIKOuKUzh5eNAXGN +GRk0S0eJaogkgXR7vkfH9ASW04u8DC/IeafIuU0cklK0SvagZjfwi1WHLtuWvWcr +5OG0DhsBJN2s8Gp9n6wnvck2+4PPAeIy1HHRBwFPVIooJVSgPXFl999Pc3TCzVAZ +wlTJPtjjGqwaBvnNTz+nxdbO8J49+5gi36Jc00YuTBg0NbkgwTygGwY/1cywnh2R +WTHGkP6c+5LsTY7BXuIxgB0w9b304klBqj07wfUeo+CyG5GcFrZbpsPZBGurWo+G +33QvuHkT3kiCxkpcJqlJvoEhXxV7rByRMVZDLaUeYyQ/pqqv6VFaQOhrKdFfv1zN +wt4+ocsMEry4GFmtJR058A7frur0MTkI6okJY5I3Exubdmmy4EHpXLJheX4MJK/P +UQ27iguQYlXuex3cdp4giKWR6LirpyF34EBumbyOg88W+gOfKko= +=Tets +-----END PGP SIGNATURE----- diff --git a/wireshark-0002-Customize-permission-denied-error.patch b/wireshark-0002-Customize-permission-denied-error.patch index cad466301e6c266625009faa3f0f5d9a0b5787f2..5c9d23710db17d4ac5bad21fa680c30515f13526 100644 --- a/wireshark-0002-Customize-permission-denied-error.patch +++ b/wireshark-0002-Customize-permission-denied-error.patch @@ -1,57 +1,22 @@ -From: Jan Safranek -Date: Fri, 26 Nov 2010 14:30:45 +0300 -Subject: [PATCH] Customize 'permission denied' error. - -Add Fedora-specific message to error output when dumpcap cannot be started -because of permissions. - -Signed-off-by: Jan Safranek - diff --git a/capture/capture_sync.c b/capture/capture_sync.c -index 2f9d2cc..b18e47f 100644 +index af08b32..2e0fcb7 100644 --- a/capture/capture_sync.c +++ b/capture/capture_sync.c -@@ -375,6 +375,7 @@ sync_pipe_start(capture_options *capture_opts, capture_session *cap_session, voi - gchar *signal_pipe_name; - #else - char errmsg[1024+1]; -+ const char *securitymsg = ""; - int sync_pipe[2]; /* pipe used to send messages from child to parent */ - enum PIPES { PIPE_READ, PIPE_WRITE }; /* Constants 0 and 1 for PIPE_READ and PIPE_WRITE */ - #endif -@@ -728,8 +729,11 @@ sync_pipe_start(capture_options *capture_opts, capture_session *cap_session, voi - dup2(sync_pipe[PIPE_WRITE], 2); - ws_close(sync_pipe[PIPE_READ]); - execv(argv[0], argv); -- g_snprintf(errmsg, sizeof errmsg, "Couldn't run %s in child process: %s", -- argv[0], g_strerror(errno)); -+ if (errno == EPERM || errno == EACCES) -+ securitymsg = "\nAre you a member of the 'wireshark' group? Try running\n'usermod -a -G wireshark _your_username_' as root."; -+ g_snprintf(errmsg, sizeof errmsg, "Couldn't run %s in child process: %s%s", -+ argv[0], g_strerror(errno), securitymsg); +@@ -1825,8 +1832,16 @@ sync_pipe_input_cb(GIOChannel *pipe_io, capture_session *cap_session) + if (!ws_strtoi32(buffer, NULL, &exec_errno)) { + ws_warning("Invalid errno: %s", buffer); + } +- primary_msg = ws_strdup_printf("Couldn't run dumpcap in child process: %s", ++ if (exec_errno == EPERM || exec_errno == EACCES) { ++ const char *securitymsg = "\nAre you a member of the 'wireshark' group? Try running\n'usermod -a -G wireshark _your_username_' as root."; ++ primary_msg = ws_strdup_printf("Couldn't run dumpcap in child process: %s%s", ++ g_strerror(exec_errno), securitymsg); ++ } ++ else { ++ primary_msg = ws_strdup_printf("Couldn't run dumpcap in child process: %s", + g_strerror(exec_errno)); ++ } + - sync_pipe_errmsg_to_parent(2, errmsg, ""); - - /* Exit with "_exit()", so that we don't close the connection -@@ -826,6 +830,7 @@ sync_pipe_open_command(char** argv, int *data_read_fd, - int i; - #else - char errmsg[1024+1]; -+ const char *securitymsg = ""; - int sync_pipe[2]; /* pipe used to send messages from child to parent */ - int data_pipe[2]; /* pipe used to send data from child to parent */ - #endif -@@ -1003,8 +1008,11 @@ sync_pipe_open_command(char** argv, int *data_read_fd, - ws_close(sync_pipe[PIPE_READ]); - ws_close(sync_pipe[PIPE_WRITE]); - execv(argv[0], argv); -- g_snprintf(errmsg, sizeof errmsg, "Couldn't run %s in child process: %s", -- argv[0], g_strerror(errno)); -+ execv(argv[0], (gpointer)argv); -+ if (errno == EPERM || errno == EACCES) -+ securitymsg = "\nAre you a member of the 'wireshark' group? Try running\n'usermod -a -G wireshark _your_username_' as root."; -+ g_snprintf(errmsg, sizeof errmsg, "Couldn't run %s in child process: %s%s", -+ argv[0], g_strerror(errno), securitymsg); - sync_pipe_errmsg_to_parent(2, errmsg, ""); - - /* Exit with "_exit()", so that we don't close the connection + cap_session->error(cap_session, primary_msg, NULL); + /* the capture child will close the sync_pipe, nothing to do for now */ + /* (an error message doesn't mean we have to stop capturing) */ diff --git a/wireshark-0003-fix-string-overrun-in-plugins-profinet.patch b/wireshark-0003-fix-string-overrun-in-plugins-profinet.patch index 8277a8c40ce7d777f7ec33cb734247a8fde79218..b71f99c73c0612f1dc327ea9257bf9bfef73c62c 100644 --- a/wireshark-0003-fix-string-overrun-in-plugins-profinet.patch +++ b/wireshark-0003-fix-string-overrun-in-plugins-profinet.patch @@ -4,10 +4,10 @@ Subject: [PATCH] fix string overrun in plugins/profinet diff --git a/plugins/epan/profinet/packet-dcom-cba.c b/plugins/epan/profinet/packet-dcom-cba.c -index 0f1658a..f7fd322 100644 +index 52c5017e1f..fb980269db 100644 --- a/plugins/epan/profinet/packet-dcom-cba.c +++ b/plugins/epan/profinet/packet-dcom-cba.c -@@ -555,7 +555,7 @@ dissect_ICBAPhysicalDevice_get_LogicalDevice_rqst(tvbuff_t *tvb, int offset, +@@ -543,7 +543,7 @@ dissect_ICBAPhysicalDevice_get_LogicalDevice_rqst(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, dcerpc_info *di, guint8 *drep) { guint32 u32Pointer; diff --git a/wireshark-0004-Restore-Fedora-specific-groups.patch b/wireshark-0004-Restore-Fedora-specific-groups.patch index 4ec1140c0b7ce1e1f1b204730d5737130c56f4a3..53e62dca57a1bcc6e1a9766355cdfcec6df5bc30 100644 --- a/wireshark-0004-Restore-Fedora-specific-groups.patch +++ b/wireshark-0004-Restore-Fedora-specific-groups.patch @@ -3,10 +3,10 @@ Date: Fri, 13 Sep 2013 14:36:55 +0400 Subject: [PATCH] Restore Fedora-specific groups Signed-off-by: Peter Lemenkov -diff --git a/org.wireshark.Wireshark.desktop b/org.wireshark.Wireshark.desktop -index 334db48..669c6f1 100644 ---- a/org.wireshark.Wireshark.desktop -+++ b/org.wireshark.Wireshark.desktop +diff --git a/resources/freedesktop/org.wireshark.Wireshark.desktop b/resources/freedesktop/org.wireshark.Wireshark.desktop +index a880a50a33..a25d67d99b 100644 +--- a/resources/freedesktop/org.wireshark.Wireshark.desktop ++++ b/resources/freedesktop/org.wireshark.Wireshark.desktop @@ -108,4 +108,4 @@ Terminal=false MimeType=application/vnd.tcpdump.pcap;application/x-pcapng;application/x-snoop;application/x-iptrace;application/x-lanalyzer;application/x-nettl;application/x-radcom;application/x-etherpeek;application/x-visualnetworks;application/x-netinstobserver;application/x-5view;application/x-tektronix-rf5;application/x-micropross-mplog;application/x-apple-packetlogger;application/x-endace-erf;application/ipfix;application/x-ixia-vwr; # Category entry according to: diff --git a/wireshark-0005-Fix-paths-in-a-wireshark.desktop-file.patch b/wireshark-0005-Fix-paths-in-a-wireshark.desktop-file.patch index e2c5b99db9c896372b78fe0dc6f7df7d9cc14d08..325afe297d9471e1c6f78ff148c3aa494ee5db14 100644 --- a/wireshark-0005-Fix-paths-in-a-wireshark.desktop-file.patch +++ b/wireshark-0005-Fix-paths-in-a-wireshark.desktop-file.patch @@ -3,10 +3,10 @@ Date: Wed, 29 Jan 2014 16:04:12 +0400 Subject: [PATCH] Fix paths in a org.wireshark.Wireshark.desktop file -diff --git a/org.wireshark.Wireshark.desktop b/org.wireshark.Wireshark.desktop -index 669c6f1..f7df1f3 100644 ---- a/org.wireshark.Wireshark.desktop -+++ b/org.wireshark.Wireshark.desktop +diff --git a/resources/freedesktop/org.wireshark.Wireshark.desktop b/resources/freedesktop/org.wireshark.Wireshark.desktop +index a880a50a33..54b3595d55 100644 +--- a/resources/freedesktop/org.wireshark.Wireshark.desktop ++++ b/resources/freedesktop/org.wireshark.Wireshark.desktop @@ -102,8 +102,8 @@ Comment[tr]=Ağ trafiği çözümleyicisi Comment[vi]=Trình phân tích giao thông mạng Comment[uk]=Аналізатор мережевого трафіку diff --git a/wireshark-0006-Move-tmp-to-var-tmp.patch b/wireshark-0006-Move-tmp-to-var-tmp.patch index 268cbaffd81cb8f1b9dbefc5ee824bc653b01da1..f7a163762e43e147d7ddc422e79dd1c26e69e530 100644 --- a/wireshark-0006-Move-tmp-to-var-tmp.patch +++ b/wireshark-0006-Move-tmp-to-var-tmp.patch @@ -5,45 +5,45 @@ Subject: [PATCH] Move /tmp to /var/tmp Fedora is using tmpfs which is limited by the size of RAM, thus we need to use different directory on different filesystem. + --- ui/qt/about_dialog.cpp | 3 +- - ui/qt/iax2_analysis_dialog.cpp | 5 +-- - ui/qt/rtp_analysis_dialog.cpp | 5 +-- - ui/qt/rtp_audio_stream.cpp | 3 +- - wsutil/tempfile.c | 9 +++--- - wsutil/tempfile.h | 4 +-- - wsutil/wstmpdir.c | 70 ++++++++++++++++++++++++++++++++++++++++++ - wsutil/wstmpdir.h | 39 +++++++++++++++++++++++ - 8 files changed, 132 insertions(+), 11 deletions(-) + ui/qt/iax2_analysis_dialog.cpp | 5 ++- + ui/qt/utils/rtp_audio_file.cpp | 3 +- + wsutil/tempfile.c | 18 +++++++- + wsutil/tempfile.h | 2 +- + wsutil/wstmpdir.c | 71 ++++++++++++++++++++++++++++++++++ + wsutil/wstmpdir.h | 39 +++++++++++++++++++ + 7 files changed, 134 insertions(+), 7 deletions(-) create mode 100644 wsutil/wstmpdir.c create mode 100644 wsutil/wstmpdir.h diff --git a/ui/qt/about_dialog.cpp b/ui/qt/about_dialog.cpp -index 31dc581..2f74285 100644 +index 752b669ac4..42c2be0fca 100644 --- a/ui/qt/about_dialog.cpp +++ b/ui/qt/about_dialog.cpp -@@ -26,6 +26,7 @@ +@@ -14,6 +14,7 @@ - #include "wireshark_application.h" + #include "main_application.h" #include +#include /* for get_tmp_dir() */ #include #include -@@ -206,7 +206,7 @@ FolderListModel::FolderListModel(QObject * parent): - appendRow(QStringList() << tr("\"File\" dialogs") << get_last_open_dir() << tr("capture files")); +@@ -185,7 +186,7 @@ FolderListModel::FolderListModel(QObject * parent): + appendRow(QStringList() << tr("\"File\" dialogs") << get_open_dialog_initial_dir() << tr("capture files")); /* temp */ -- appendRow(QStringList() << tr("Temp") << g_get_tmp_dir() << tr("untitled capture files")); -+ appendRow(QStringList() << tr("Temp") << get_tmp_dir() << tr("untitled capture files")); +- appendRow(QStringList() << tr("Temp") << (global_capture_opts.temp_dir && global_capture_opts.temp_dir[0] ? global_capture_opts.temp_dir : g_get_tmp_dir()) << tr("untitled capture files")); ++ appendRow(QStringList() << tr("Temp") << (global_capture_opts.temp_dir && global_capture_opts.temp_dir[0] ? global_capture_opts.temp_dir : get_tmp_dir()) << tr("untitled capture files")); /* pers conf */ appendRow(QStringList() << tr("Personal configuration") diff --git a/ui/qt/iax2_analysis_dialog.cpp b/ui/qt/iax2_analysis_dialog.cpp -index ee4e5fd..fe17a95 100644 +index 07b9b42e01..fb09de989b 100644 --- a/ui/qt/iax2_analysis_dialog.cpp +++ b/ui/qt/iax2_analysis_dialog.cpp -@@ -37,6 +37,7 @@ +@@ -25,6 +25,7 @@ #include "ui/rtp_stream.h" #endif #include @@ -51,7 +51,7 @@ index ee4e5fd..fe17a95 100644 #include #include -@@ -271,10 +272,10 @@ Iax2AnalysisDialog::Iax2AnalysisDialog(QWidget &parent, CaptureFile &cf) : +@@ -255,10 +256,10 @@ Iax2AnalysisDialog::Iax2AnalysisDialog(QWidget &parent, CaptureFile &cf) : // We keep our temp files open for the lifetime of the dialog. The GTK+ // UI opens and closes at various points. @@ -65,7 +65,7 @@ index ee4e5fd..fe17a95 100644 rev_tempfile_->open(); diff --git a/ui/qt/utils/rtp_audio_file.cpp b/ui/qt/utils/rtp_audio_file.cpp -index 591a63b..203f5c5 100644 +index 591a63bbf3..203f5c5286 100644 --- a/ui/qt/utils/rtp_audio_file.cpp +++ b/ui/qt/utils/rtp_audio_file.cpp @@ -31,6 +31,7 @@ @@ -86,66 +86,70 @@ index 591a63b..203f5c5 100644 } else { sample_file_ = new QBuffer(this); diff --git a/wsutil/tempfile.c b/wsutil/tempfile.c -index 5082452..f751a7c 100644 +index 531ed91..bd6fd60 100644 --- a/wsutil/tempfile.c +++ b/wsutil/tempfile.c -@@ -12,10 +12,12 @@ - - #include +@@ -10,6 +10,8 @@ + + #include "config.h" #include "tempfile.h" +#include +#include /* for get_tmp_dir() */ - + + #include + +@@ -39,7 +41,7 @@ sanitize_prefix(const char *prefix) + /** * Create a tempfile with the given prefix (e.g. "wireshark"). The path - * is created using g_file_open_tmp. + * is created using get_tmp_dir. * + * @param tempdir [in] If not NULL, the directory in which to create the file. * @param namebuf [in,out] If not NULL, receives the full path of the temp file. - * Must be freed. -@@ -30,6 +31,9 @@ create_tempfile(gchar **namebuf, const char *pfx, const char *sfx, GError **err) +@@ -55,13 +57,25 @@ create_tempfile(const char *tempdir, char **namebuf, const char *pfx, const char { int fd; - gchar *safe_pfx = NULL; + char *safe_pfx = sanitize_prefix(pfx); + gchar *tmp_file; + const char *tmp_dir; + int old_mask; - - if (pfx) { - /* The characters in "delimiters" come from: -@@ -49,7 +53,15 @@ create_tempfile(gchar **namebuf, const char *pfx, const char *sfx, GError **err) - gchar* filetmpl = g_strdup_printf("%sXXXXXX%s", safe_pfx ? safe_pfx : "", sfx ? sfx : ""); - g_free(safe_pfx); - -- fd = g_file_open_tmp(filetmpl, namebuf, err); -+ tmp_dir = get_tmp_dir(); -+ tmp_file = g_strconcat(tmp_dir, "/", filetmpl, NULL); + + if (tempdir == NULL || tempdir[0] == '\0') { + /* Use OS default tempdir behaviour */ + char* filetmpl = ws_strdup_printf("%sXXXXXX%s", safe_pfx ? safe_pfx : "", sfx ? sfx : ""); + g_free(safe_pfx); + +- fd = g_file_open_tmp(filetmpl, namebuf, err); ++ tmp_dir = get_tmp_dir(); ++ tmp_file = g_strconcat(tmp_dir, "/", filetmpl, NULL); + -+ if (namebuf) -+ *namebuf = tmp_file; ++ if (namebuf) ++ *namebuf = tmp_file; + -+ old_mask = ws_umask(0077); -+ fd = mkstemps(tmp_file, sfx ? (int) strlen(sfx) : 0); -+ ws_umask(old_mask); - - g_free(filetmpl); - return fd; ++ old_mask = ws_umask(0077); ++ fd = mkstemps(tmp_file, sfx ? (int) strlen(sfx) : 0); ++ ws_umask(old_mask); ++ + g_free(filetmpl); + } + else { diff --git a/wsutil/tempfile.h b/wsutil/tempfile.h -index 1dca2df..bb3160c 100644 +index 70031b5419..72011e265a 100644 --- a/wsutil/tempfile.h +++ b/wsutil/tempfile.h -@@ -45,7 +45,7 @@ WS_DLL_PUBLIC char *get_tempfile_path(const char *filename); +@@ -23,7 +23,7 @@ extern "C" { /** * Create a tempfile with the given prefix (e.g. "wireshark"). The path - * is created using g_file_open_tmp. + * is created using get_tmp_dir and mkstemp. * + * @param tempdir [in] If not NULL, the directory in which to create the file. * @param namebuf [in,out] If not NULL, receives the full path of the temp file. - * Must be freed. diff --git a/wsutil/wstmpdir.c b/wsutil/wstmpdir.c new file mode 100644 -index 0000000..d8b733b +index 0000000000..9128d354ce --- /dev/null +++ b/wsutil/wstmpdir.c @@ -0,0 +1,71 @@ @@ -222,7 +226,7 @@ index 0000000..d8b733b +} diff --git a/wsutil/wstmpdir.h b/wsutil/wstmpdir.h new file mode 100644 -index 0000000..07ac583 +index 0000000000..07ac5837ac --- /dev/null +++ b/wsutil/wstmpdir.h @@ -0,0 +1,39 @@ @@ -266,4 +270,5 @@ index 0000000..07ac583 + +#endif -- -2.13.0 +2.37.3 + diff --git a/wireshark-0007-cmakelists.patch b/wireshark-0007-cmakelists.patch index 0d75fc35c0ed76cd2226b77d8f5171fdc8809057..18064e220e1b365e641746ca17de5ce570d5cc58 100644 --- a/wireshark-0007-cmakelists.patch +++ b/wireshark-0007-cmakelists.patch @@ -1,20 +1,20 @@ diff --git a/wsutil/CMakeLists.txt b/wsutil/CMakeLists.txt -index 0367cd1..6382a2c 100644 +index a55086c..0149801 100644 --- a/wsutil/CMakeLists.txt +++ b/wsutil/CMakeLists.txt -@@ -69,6 +69,7 @@ set(WSUTIL_PUBLIC_HEADERS - ws_mempbrk_int.h - ws_pipe.h +@@ -80,6 +80,7 @@ set(WSUTIL_PUBLIC_HEADERS ws_roundup.h + ws_strptime.h + wsgcrypt.h + wstmpdir.h wsjson.h wslog.h xtea.h -@@ -118,6 +118,7 @@ set(WSUTIL_COMMON_FILES - ws_getopt.c - ws_mempbrk.c +@@ -135,6 +136,7 @@ set(WSUTIL_COMMON_FILES ws_pipe.c -+ wstmpdir.c + ws_strptime.c wsgcrypt.c ++ wstmpdir.c wsjson.c wslog.c + xtea.c diff --git a/wireshark-0008-pkgconfig.patch b/wireshark-0008-pkgconfig.patch new file mode 100644 index 0000000000000000000000000000000000000000..3ef90b0cac8e410aedc670cdc808c521f14b6a27 --- /dev/null +++ b/wireshark-0008-pkgconfig.patch @@ -0,0 +1,14 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 27fa752..7bdc036 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -4037,9 +4037,6 @@ install( + "${CMAKE_BINARY_DIR}/wireshark.pc" + DESTINATION + ${CMAKE_INSTALL_LIBDIR}/pkgconfig +- COMPONENT +- "Development" +- EXCLUDE_FROM_ALL + ) + + install( diff --git a/wireshark-3.6.14.tar.xz b/wireshark-4.2.4.tar.xz similarity index 73% rename from wireshark-3.6.14.tar.xz rename to wireshark-4.2.4.tar.xz index 1655c0b1f789c1249c6634b12067c64d2cb4ae6f..614475d37c91a3168a8e2ad77f6046027e905f47 100644 Binary files a/wireshark-3.6.14.tar.xz and b/wireshark-4.2.4.tar.xz differ diff --git a/wireshark.spec b/wireshark.spec index 09c5c41e52fe7753c9c0d3bb15a7293e3c4f6711..2434cf24d7b7e31424fd5010b36695306572ff66 100644 --- a/wireshark.spec +++ b/wireshark.spec @@ -1,11 +1,11 @@ %undefine __cmake_in_source_build -%global plugins_version 3.6 +%global plugins_version 4.2 %define _lto_cflags %{nil} Summary: Network traffic analyzer Name: wireshark -Version: 3.6.14 -Release: 8 +Version: 4.2.4 +Release: 1 Epoch: 1 License: GPL+ Url: http://www.wireshark.org/ @@ -21,20 +21,7 @@ Patch4: wireshark-0004-Restore-Fedora-specific-groups.patch Patch5: wireshark-0005-Fix-paths-in-a-wireshark.desktop-file.patch Patch6: wireshark-0006-Move-tmp-to-var-tmp.patch Patch7: wireshark-0007-cmakelists.patch -Patch8: CVE-2023-3648.patch -Patch9: CVE-2023-3649.patch -Patch10: CVE-2023-2906.patch -Patch11: CVE-2023-4513-1.patch -Patch12: CVE-2023-4513-2.patch -Patch13: CVE-2023-4511.patch -Patch14: CVE-2023-5371.patch -# https://gitlab.com/wireshark/wireshark/-/commit/197e96f05303af0340b7e626f2b15c2edbf350b0 -Patch15: CVE-2023-6175.patch -Patch16: Fix-libvirt-build-fail.patch -Patch17: CVE-2024-0208.patch -Patch18: CVE-2024-0209.patch -# https://gitlab.com/wireshark/wireshark/-/commit/28fdce547c417b868c521f87fb58f71ca6b1e3f7 -Patch19: CVE-2023-0666.patch +Patch8: wireshark-0008-pkgconfig.patch Requires: xdg-utils Requires: hicolor-icon-theme @@ -68,10 +55,13 @@ BuildRequires: perl(Pod::Html) BuildRequires: perl(Pod::Man) BuildRequires: perl(open) Buildrequires: libssh-devel -BuildRequires: qt5-linguist -BuildRequires: qt5-qtbase-devel -BuildRequires: qt5-qtmultimedia-devel -BuildRequires: qt5-qtsvg-devel +BuildRequires: qt6-qttools-devel +BuildRequires: qt6-linguist +BuildRequires: qt6-qtbase-devel +BuildRequires: qt6-qt5compat-devel +BuildRequires: qt6-qtmultimedia-devel +BuildRequires: qt6-qtsvg-devel +BuildRequires: speexdsp-devel BuildRequires: zlib-devel BuildRequires: asciidoctor Buildrequires: git-core @@ -120,6 +110,7 @@ Files for help with wireshark. -DBUILD_randpktdump=OFF \ -DBUILD_androiddump=ON \ -DENABLE_SMI=ON \ + -DUSE_qt6=ON \ -DENABLE_PLUGINS=ON \ -DENABLE_NETLINK=ON \ -DBUILD_dcerpcidl2wrs=OFF \ @@ -139,13 +130,12 @@ mkdir -p "${IDIR}/epan/crypt" mkdir -p "${IDIR}/epan/ftypes" mkdir -p "${IDIR}/epan/dfilter" mkdir -p "${IDIR}/epan/dissectors" -mkdir -p "${IDIR}/epan/wmem" +mkdir -p "${IDIR}/wsutil/wmem" mkdir -p "${IDIR}/wiretap" mkdir -p "${IDIR}/wsutil" mkdir -p %{buildroot}%{_udevrulesdir} install -m 644 config.h epan/register.h "${IDIR}/" install -m 644 cfile.h file.h "${IDIR}/" -install -m 644 ws_symbol_export.h "${IDIR}/" install -m 644 epan/*.h "${IDIR}/epan/" install -m 644 epan/crypt/*.h "${IDIR}/epan/crypt" install -m 644 epan/ftypes/*.h "${IDIR}/epan/ftypes" @@ -153,7 +143,9 @@ install -m 644 epan/dfilter/*.h "${IDIR}/epan/dfilter" install -m 644 epan/dissectors/*.h "${IDIR}/epan/dissectors" install -m 644 wiretap/*.h "${IDIR}/wiretap" install -m 644 wsutil/*.h "${IDIR}/wsutil" -install -m 644 ws_diag_control.h "${IDIR}/" +install -m 644 wsutil/wmem/*.h "${IDIR}/wsutil/wmem" +install -m 644 include/*.h "${IDIR}/" +install -m 644 ws_version.h "${IDIR}/" install -m 644 %{SOURCE2} %{buildroot}%{_udevrulesdir} install -Dpm 644 %{SOURCE3} %{buildroot}%{_sysusersdir}/%{name}.conf touch %{buildroot}%{_bindir}/%{name} @@ -187,8 +179,6 @@ exit 0 %dir %{_libdir}/wireshark/extcap %dir %{_libdir}/wireshark/plugins %{_libdir}/wireshark/extcap/* -%dir %{_libdir}/wireshark/cmake -%{_libdir}/wireshark/cmake/*.cmake %dir %{_libdir}/wireshark/plugins/%{plugins_version} %dir %{_libdir}/wireshark/plugins/%{plugins_version}/epan %dir %{_libdir}/wireshark/plugins/%{plugins_version}/wiretap @@ -198,6 +188,7 @@ exit 0 %{_libdir}/wireshark/plugins/%{plugins_version}/codecs/*.so %dir %{_datadir}/wireshark %{_datadir}/wireshark/* +%{_datadir}/doc/wireshark/* %files devel %{_includedir}/wireshark @@ -209,6 +200,9 @@ exit 0 %{_mandir}/man?/* %changelog +* Wed Apr 24 2024 yaoxin - 1:4.2.4-1 +- Upgrade to 4.2.4 + * Mon Mar 25 2024 yaoxin - 1:3.6.14-8 - Fix CVE-2023-0666