aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2015-09-29 22:30:06 +0200
committerPeter Wu <peter@lekensteyn.nl>2015-09-30 12:28:04 +0000
commit01bd832b9df9570ddfd81ab4985f71ff6abd9b12 (patch)
tree82f747704a0ca93dd9d349c541def89fe5812daf
parent6ac0d846ecc1110965e31b6efedbc3280d42b2b0 (diff)
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>
-rw-r--r--ui/gtk/rtp_stream_dlg.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/ui/gtk/rtp_stream_dlg.c b/ui/gtk/rtp_stream_dlg.c
index 8916eed598..3f4988422a 100644
--- a/ui/gtk/rtp_stream_dlg.c
+++ b/ui/gtk/rtp_stream_dlg.c
@@ -1087,7 +1087,12 @@ rtpstream_dlg_create (void)
static 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;
@@ -1098,6 +1103,7 @@ 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);
}