aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDario Lombardo <lomato@gmail.com>2020-01-09 15:20:04 +0100
committerAnders Broman <a.broman58@gmail.com>2020-01-10 04:59:36 +0000
commitad2584f4373cfe79433f25f30a4e11c0b928f70e (patch)
tree2baa90001a3c78b113d9e209d0c5c8e7dc3c3fe7
parent1bbac91d33ea9711de1dd052fea74cbaff72761f (diff)
tpncp: replace stack variable with dynamic allocation.
The size of the stack triggers an error on clang: ../epan/dissectors/packet-tpncp.c:410:1: error: stack frame size of 26152 bytes in function 'init_tpncp_data_fields_info' [-Werror,-Wframe-larger-than=] init_tpncp_data_fields_info(tpncp_data_field_info *data_fields_info, FILE *file) ^ 1 error generated. Change-Id: Ia7d1d609b339eff6ffa023d9c0bf47caf6bd9851 Reviewed-on: https://code.wireshark.org/review/35715 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r--epan/dissectors/packet-tpncp.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/epan/dissectors/packet-tpncp.c b/epan/dissectors/packet-tpncp.c
index cc1d45d9f0..50a982975f 100644
--- a/epan/dissectors/packet-tpncp.c
+++ b/epan/dissectors/packet-tpncp.c
@@ -418,7 +418,7 @@ init_tpncp_data_fields_info(tpncp_data_field_info *data_fields_info, FILE *file)
guint idx;
tpncp_data_field_info *current_tpncp_data_field_info = NULL;
hf_register_info hf_entr;
- gboolean registered_struct_ids[MAX_TPNCP_DB_SIZE];
+ gboolean* registered_struct_ids = wmem_alloc0_array(wmem_epan_scope(), gboolean, MAX_TPNCP_DB_SIZE);
static hf_register_info hf_tpncp[] = {
{
@@ -519,8 +519,6 @@ init_tpncp_data_fields_info(tpncp_data_field_info *data_fields_info, FILE *file)
}
};
- memset(registered_struct_ids, 0, sizeof (registered_struct_ids));
-
/* Register common fields of hf_register_info structure. */
hf_entr.hfinfo.type = FT_NONE;
hf_entr.hfinfo.strings = NULL;