From 86f91643656e0b8f82f7d66903cec089d5ed4208 Mon Sep 17 00:00:00 2001 From: Pascal Quantin Date: Sun, 5 Jun 2016 16:27:37 +0200 Subject: [PATCH] Initialize all header_field_info members Change-Id: Id86d17f1e321b8cc73fb732aaf674e1420a0a745 Reviewed-on: https://code.wireshark.org/review/15737 Reviewed-by: Pascal Quantin Petri-Dish: Pascal Quantin Tested-by: Petri Dish Buildbot Reviewed-by: Alexis La Goutte --- epan/dissectors/asn1/ldap/packet-ldap-template.c | 4 ++-- epan/dissectors/packet-http.c | 4 ++-- epan/dissectors/packet-imf.c | 4 ++-- epan/dissectors/packet-ldap.c | 4 ++-- epan/dissectors/packet-tpncp.c | 8 ++------ epan/dissectors/packet-xml.c | 6 +----- 6 files changed, 11 insertions(+), 19 deletions(-) diff --git a/epan/dissectors/asn1/ldap/packet-ldap-template.c b/epan/dissectors/asn1/ldap/packet-ldap-template.c index 5efdfe1716..93506058fa 100644 --- a/epan/dissectors/asn1/ldap/packet-ldap-template.c +++ b/epan/dissectors/asn1/ldap/packet-ldap-template.c @@ -584,9 +584,9 @@ attribute_types_initialize_cb(void) hf[i].hfinfo.type = FT_STRING; hf[i].hfinfo.display = BASE_NONE; hf[i].hfinfo.strings = NULL; + hf[i].hfinfo.bitmask = 0; hf[i].hfinfo.blurb = g_strdup(attribute_types[i].attribute_desc); - hf[i].hfinfo.same_name_prev_id = -1; - hf[i].hfinfo.same_name_next = NULL; + HFILL_INIT(hf[i]); g_hash_table_insert(attribute_types_hash, attribute_type, hf_id); } diff --git a/epan/dissectors/packet-http.c b/epan/dissectors/packet-http.c index 84db7c5b98..ad71e485f5 100644 --- a/epan/dissectors/packet-http.c +++ b/epan/dissectors/packet-http.c @@ -2473,9 +2473,9 @@ header_fields_initialize_cb(void) hf[i].hfinfo.type = FT_STRING; hf[i].hfinfo.display = BASE_NONE; hf[i].hfinfo.strings = NULL; + hf[i].hfinfo.bitmask = 0; hf[i].hfinfo.blurb = g_strdup(header_fields[i].header_desc); - hf[i].hfinfo.same_name_prev_id = -1; - hf[i].hfinfo.same_name_next = NULL; + HFILL_INIT(hf[i]); g_hash_table_insert(header_fields_hash, header_name_key, hf_id); } diff --git a/epan/dissectors/packet-imf.c b/epan/dissectors/packet-imf.c index 0a5c99bd08..0792a0bf38 100644 --- a/epan/dissectors/packet-imf.c +++ b/epan/dissectors/packet-imf.c @@ -907,9 +907,9 @@ header_fields_initialize_cb (void) hf[i].hfinfo.type = FT_STRING; hf[i].hfinfo.display = BASE_NONE; hf[i].hfinfo.strings = NULL; + hf[i].hfinfo.bitmask = 0; hf[i].hfinfo.blurb = g_strdup (header_fields[i].description); - hf[i].hfinfo.same_name_prev_id = -1; - hf[i].hfinfo.same_name_next = NULL; + HFILL_INIT(hf[i]); imffield = (struct imf_field *)g_malloc (sizeof (struct imf_field)); imffield->hf_id = hf_id; diff --git a/epan/dissectors/packet-ldap.c b/epan/dissectors/packet-ldap.c index 8f8b90d461..95ba5258bf 100644 --- a/epan/dissectors/packet-ldap.c +++ b/epan/dissectors/packet-ldap.c @@ -798,9 +798,9 @@ attribute_types_initialize_cb(void) hf[i].hfinfo.type = FT_STRING; hf[i].hfinfo.display = BASE_NONE; hf[i].hfinfo.strings = NULL; + hf[i].hfinfo.bitmask = 0; hf[i].hfinfo.blurb = g_strdup(attribute_types[i].attribute_desc); - hf[i].hfinfo.same_name_prev_id = -1; - hf[i].hfinfo.same_name_next = NULL; + HFILL_INIT(hf[i]); g_hash_table_insert(attribute_types_hash, attribute_type, hf_id); } diff --git a/epan/dissectors/packet-tpncp.c b/epan/dissectors/packet-tpncp.c index ff264b7873..7cc79d6a7f 100644 --- a/epan/dissectors/packet-tpncp.c +++ b/epan/dissectors/packet-tpncp.c @@ -578,16 +578,12 @@ static gint init_tpncp_data_fields_info(tpncp_data_field_info *data_fields_info, } }; - /* Register common fields of hf_register_info struture. */ + /* Register common fields of hf_register_info structure. */ hf_entr.hfinfo.type = FT_NONE; hf_entr.hfinfo.strings = NULL; hf_entr.hfinfo.bitmask = 0x0; hf_entr.hfinfo.blurb = NULL; - hf_entr.hfinfo.id = 0; - hf_entr.hfinfo.parent = 0; - hf_entr.hfinfo.ref_type = HF_REF_TYPE_NONE; - hf_entr.hfinfo.same_name_next = NULL; - hf_entr.hfinfo.same_name_prev_id = -1; + HFILL_INIT(hf_entr); if (!was_registered) { /* Register non-standard data should be done only once. */ diff --git a/epan/dissectors/packet-xml.c b/epan/dissectors/packet-xml.c index ca10bdb2d9..4d2769aaf5 100644 --- a/epan/dissectors/packet-xml.c +++ b/epan/dissectors/packet-xml.c @@ -819,11 +819,7 @@ static void add_xml_field(wmem_array_t *hfs, int *p_id, const gchar *name, const hfri.hfinfo.strings = NULL; hfri.hfinfo.bitmask = 0x0; hfri.hfinfo.blurb = NULL; - hfri.hfinfo.id = 0; - hfri.hfinfo.parent = 0; - hfri.hfinfo.ref_type = HF_REF_TYPE_NONE; - hfri.hfinfo.same_name_next = NULL; - hfri.hfinfo.same_name_prev_id = -1; + HFILL_INIT(hfri); wmem_array_append_one(hfs, hfri); }