From c0514ac4330695c66d346067d99a429c2bb6abbe Mon Sep 17 00:00:00 2001 From: Michael Mann Date: Sat, 25 Nov 2017 23:42:47 -0500 Subject: Bugfix DCE/RPC Decode As for GTK. An attempt at optimization broke GTK DCE/RPC Decode As because DCE/RPC dissector tables aren't FT_UINT type. The "optimization" was trying to retrieve dissector handle from FT_UINT typed dissector table. Move retrieval of dissector handle to under FT_UINT check Change-Id: Id81cd79db60263155392aaac0c796a6484ef7504 Reviewed-on: https://code.wireshark.org/review/24589 Reviewed-by: Michael Mann Petri-Dish: Michael Mann Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman --- ui/gtk/decode_as_dlg.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ui/gtk/decode_as_dlg.c b/ui/gtk/decode_as_dlg.c index 86f231bc63..b7c6808baa 100644 --- a/ui/gtk/decode_as_dlg.c +++ b/ui/gtk/decode_as_dlg.c @@ -692,14 +692,14 @@ decode_simple (GtkWidget *notebook_pg) guint8 saved_curr_layer_num = cfile.edt->pi.curr_layer_num; cfile.edt->pi.curr_layer_num = (guint8)GPOINTER_TO_UINT(g_object_get_data(G_OBJECT(notebook_pg), E_PAGE_CURR_LAYER_NUM)); value_ptr = entry->values[requested_index].build_values[value_loop](&cfile.edt->pi); - /* Find the handle currently associated with the value */ - temp_handle = dissector_get_uint_handle(sub_dissectors, GPOINTER_TO_UINT(value_ptr)); if (abbrev != NULL && strcmp(abbrev, "(default)") == 0) { add_reset_list = entry->reset_value(table_name, value_ptr); /* For now, only numeric dissector tables can use preferences */ if (IS_FT_UINT(dissector_table_get_type(sub_dissectors))) { + /* Find the handle currently associated with the value */ + temp_handle = dissector_get_uint_handle(sub_dissectors, GPOINTER_TO_UINT(value_ptr)); if (temp_handle != NULL) { module = prefs_find_module(proto_get_protocol_filter_name(dissector_handle_get_protocol_index(temp_handle))); pref_value = prefs_find_preference(module, table_name); @@ -723,6 +723,8 @@ decode_simple (GtkWidget *notebook_pg) } } else { + /* Find the handle currently associated with the value */ + temp_handle = dissector_get_uint_handle(sub_dissectors, GPOINTER_TO_UINT(value_ptr)); if (temp_handle != NULL) { module = prefs_find_module(proto_get_protocol_filter_name(dissector_handle_get_protocol_index(temp_handle))); pref_value = prefs_find_preference(module, table_name); -- cgit v1.2.3