From: Sami Kerola Date: Sat, 3 Sep 2016 22:25:17 +0000 (+0100) Subject: crash fix: add ctl structure to gtk Pause_clicked() handler X-Git-Tag: v0.88~26^2~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=95335ef181e904712b4c18a2b9d429a252a73a63;p=thirdparty%2Fmtr.git 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 --- 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,