From 95335ef181e904712b4c18a2b9d429a252a73a63 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Sat, 3 Sep 2016 23:25:17 +0100 Subject: [PATCH] crash fix: add ctl structure to gtk Pause_clicked() handler Without this handler net_max() will crash with SIGSEGV at line 1209. gdb backtrace gave clear hint what was the problem, and where it needs to be fixed. #0 0x4109db in net_max /home/src/mtr/net.c:1209 #1 0x42478e in gtk_redraw /home/src/mtr/gtk.c:508 #2 0x422fc7 in Pause_clicked /home/src/mtr/gtk.c:121 --- gtk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk.c b/gtk.c index e7f71af..1d730c3 100644 --- a/gtk.c +++ b/gtk.c @@ -259,7 +259,7 @@ static void Toolbar_fill(struct mtr_ctl *ctl, GtkWidget *Toolbar) Pause_Button = gtk_toggle_button_new_with_mnemonic("_Pause"); gtk_box_pack_end(GTK_BOX(Toolbar), Pause_Button, FALSE, FALSE, 0); g_signal_connect(GTK_OBJECT(Pause_Button), "clicked", - GTK_SIGNAL_FUNC(Pause_clicked), NULL); + GTK_SIGNAL_FUNC(Pause_clicked), ctl); /* allow root only to set zero delay */ Adjustment = (GtkAdjustment *)gtk_adjustment_new(ctl->WaitTime, -- 2.47.2