From b09f79f4141b403353c4afb2680739b7670d3045 Mon Sep 17 00:00:00 2001 From: Jeff Morriss Date: Wed, 14 Apr 2010 18:39:00 +0000 Subject: Be sure we initialize the p_id in hf's. This fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3010 . Also finish the implementation of ShowTimes for GOGs so that the variable gets initialized (preventing another uninitialized variable warning from Valgrind). svn path=/trunk/; revision=32465 --- plugins/mate/mate.h | 2 +- plugins/mate/mate_grammar.lemon | 39 ++++++++++++++++++++++----------------- plugins/mate/mate_setup.c | 7 +++++-- 3 files changed, 28 insertions(+), 20 deletions(-) diff --git a/plugins/mate/mate.h b/plugins/mate/mate.h index b920d5462a..370e5913fd 100644 --- a/plugins/mate/mate.h +++ b/plugins/mate/mate.h @@ -244,7 +244,7 @@ typedef struct _mate_config { struct _gog_defaults { float expiration; - + gboolean show_times; gop_tree_mode_t gop_tree_mode; } gog; } defaults; diff --git a/plugins/mate/mate_grammar.lemon b/plugins/mate/mate_grammar.lemon index 5db1939fb8..2afa8dec2d 100644 --- a/plugins/mate/mate_grammar.lemon +++ b/plugins/mate/mate_grammar.lemon @@ -319,7 +319,7 @@ gop_tree_mode_default ::= . gop_show_times_default ::= SHOW_TIMES_KW true_false(B) SEMICOLON. { mc->defaults.gop.show_times = B; } gop_show_times_default ::= . -gog_defaults ::= GOG_KW OPEN_BRACE gog_expiration_default gop_tree_mode_default gog_goptree_default CLOSE_BRACE SEMICOLON. +gog_defaults ::= GOG_KW OPEN_BRACE gog_expiration_default gop_tree_mode_default gog_goptree_default gog_show_times_default CLOSE_BRACE SEMICOLON. gog_defaults ::= . gog_expiration_default ::= EXPIRATION_KW time_value(B) SEMICOLON. { mc->defaults.gop.expiration = B; } @@ -328,6 +328,9 @@ gog_expiration_default ::= . gog_goptree_default ::= GOP_TREE_KW gop_tree_type(B) SEMICOLON. { mc->defaults.gog.gop_tree_mode = B; } gog_goptree_default ::= . +gog_show_times_default ::= SHOW_TIMES_KW true_false(B) SEMICOLON. { mc->defaults.gog.show_times = B; } +gog_show_times_default ::= . + /******************************************* TRANSFORM */ @@ -541,19 +544,19 @@ gop_decl(A) ::= GOP_KW NAME(Name) ON_KW pdu_name(PduName) MATCH_KW avpl(Key) OPE cfg->on_pdu = PduName; cfg->key = Key; - cfg->drop_unassigned = DropUnassigned; - cfg->show_times = ShowTimes; - cfg->pdu_tree_mode = TreeMode; - cfg->expiration = Expiration; - cfg->idle_timeout = IdleTimeout; - cfg->lifetime = Lifetime; - cfg->start = Start; - cfg->stop = Stop; - cfg->transforms = Transform; - - merge_avpl(cfg->extra,Extra,TRUE); - delete_avpl(Extra,TRUE); -} + cfg->drop_unassigned = DropUnassigned; + cfg->show_times = ShowTimes; + cfg->pdu_tree_mode = TreeMode; + cfg->expiration = Expiration; + cfg->idle_timeout = IdleTimeout; + cfg->lifetime = Lifetime; + cfg->start = Start; + cfg->stop = Stop; + cfg->transforms = Transform; + + merge_avpl(cfg->extra,Extra,TRUE); + delete_avpl(Extra,TRUE); + } gop_drop_unassigned_statement(A) ::= DROP_UNASSIGNED_KW true_false(B) SEMICOLON. { A = B; } gop_drop_unassigned_statement(A) ::= . { A = mc->defaults.gop.drop_unassigned; } @@ -614,7 +617,8 @@ gog_decl ::= GOG_KW NAME(Name) OPEN_BRACE transform_list_statement(Transforms) gog_expiration_statement(Expiration) gog_goptree_statement(Tree) - CLOSE_BRACE SEMICOLON. { + show_times_statement(ShowTimes) + CLOSE_BRACE SEMICOLON. { mate_cfg_gog* cfg = NULL; if ( g_hash_table_lookup(mc->gogcfgs,Name) ) { @@ -627,9 +631,10 @@ gog_decl ::= GOG_KW NAME(Name) OPEN_BRACE cfg->gop_tree_mode = Tree; cfg->transforms = Transforms; cfg->keys = Keys; + cfg->show_times = ShowTimes; - merge_avpl(cfg->extra,Extra,TRUE); - delete_avpl(Extra,TRUE); + merge_avpl(cfg->extra,Extra,TRUE); + delete_avpl(Extra,TRUE); } gog_goptree_statement(A) ::= GOP_TREE_KW gop_tree_type(B) SEMICOLON. { A = B; } diff --git a/plugins/mate/mate_setup.c b/plugins/mate/mate_setup.c index 265bb263dd..94a1eb9dc5 100644 --- a/plugins/mate/mate_setup.c +++ b/plugins/mate/mate_setup.c @@ -136,6 +136,7 @@ extern mate_cfg_gog* new_gogcfg(gchar* name) { cfg->hfid_gog_num_of_gops = -1; cfg->hfid_gog_gop = -1; cfg->hfid_gog_gopstart = -1; + cfg->hfid_gog_gopstop = -1; cfg->hfid_start_time = -1; cfg->hfid_stop_time = -1; @@ -218,10 +219,10 @@ extern gchar* add_ranges(gchar* range,GPtrArray* range_ptr_arr) { static void new_attr_hfri(gchar* item_name, GHashTable* hfids, gchar* name) { int* p_id = g_malloc(sizeof(int)); - hf_register_info hfri; memset(&hfri, 0, sizeof hfri); + *p_id = -1; hfri.p_id = p_id; hfri.hfinfo.name = g_strdup(name); hfri.hfinfo.abbrev = g_strdup_printf("mate.%s.%s",item_name,name); @@ -605,6 +606,7 @@ extern mate_config* mate_make_config(const gchar* filename, int mate_hfid) { matecfg->defaults.pdu.match_mode = AVPL_STRICT; matecfg->defaults.pdu.replace_mode = AVPL_INSERT; + /* gop prefs */ matecfg->defaults.gop.expiration = -1.0; matecfg->defaults.gop.idle_timeout = -1.0; matecfg->defaults.gop.lifetime = -1.0; @@ -612,8 +614,9 @@ extern mate_config* mate_make_config(const gchar* filename, int mate_hfid) { matecfg->defaults.gop.show_times = TRUE; matecfg->defaults.gop.drop_unassigned = FALSE; - /* gop prefs */ + /* gog prefs */ matecfg->defaults.gog.expiration = 5.0; + matecfg->defaults.gog.show_times = TRUE; matecfg->defaults.gog.gop_tree_mode = GOP_BASIC_TREE; /* what to dbgprint */ -- cgit v1.2.3