diff options
author | Peter Wu <peter@lekensteyn.nl> | 2015-09-29 22:30:06 +0200 |
---|---|---|
committer | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2015-10-01 19:18:26 +0000 |
commit | dc625e90d9d11513a7b33314ce8e461368522e97 (patch) | |
tree | 73d91b1158e7d86378cd53af2b43760fa11fd08d | |
parent | 4cbcbbc88a6851b6e09524bf6fccdd719fd61233 (diff) | |
download | wireshark-dc625e90d9d11513a7b33314ce8e461368522e97.tar.gz |
gtk: Fix crash on Analyze RTP stream
When updating the RTP streams list, the data associated with the current
selection becomes invalid when the old list is cleared.
gtk_list_store_clear somehow triggers the selection callback which
attempts to access the invalid memory.
Avoid this by disabling selectability while clearing the list.
Bug: 10016
Change-Id: Id5126ec5ffa41fa6a65339f4453546223124ed67
Reviewed-on: https://code.wireshark.org/review/10690
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
(cherry picked from commit 01bd832b9df9570ddfd81ab4985f71ff6abd9b12)
Reviewed-on: https://code.wireshark.org/review/10725
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
-rw-r--r-- | ui/gtk/rtp_stream_dlg.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ui/gtk/rtp_stream_dlg.c b/ui/gtk/rtp_stream_dlg.c index 6485eb6ce2..6c11fe4ed7 100644 --- a/ui/gtk/rtp_stream_dlg.c +++ b/ui/gtk/rtp_stream_dlg.c @@ -1076,7 +1076,12 @@ rtpstream_dlg_create (void) /* list: pointer to list of rtp_stream_info_t* */ void rtpstream_dlg_update(GList *list_lcl) { + GtkTreeSelection *selection; if (rtp_stream_dlg != NULL) { + /* Disable selection to avoid rtpstream_view_selection_func from + * triggering and thereby accessing invalid memory. */ + selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(list)); + gtk_tree_selection_set_mode(selection, GTK_SELECTION_NONE); gtk_list_store_clear(list_store); streams_nb = 0; @@ -1087,6 +1092,7 @@ void rtpstream_dlg_update(GList *list_lcl) list_lcl = g_list_next(list_lcl); } + gtk_tree_selection_set_mode(selection, GTK_SELECTION_MULTIPLE); rtpstream_on_unselect(NULL, NULL); } |