From e4b480c8d791a368b72010f978696998bba75e5d Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Wed, 15 Jun 2011 11:37:10 +0200 Subject: Bug #652620 - Can use uninitialized memory in alarm-notification-dialog --- calendar/gui/alarm-notify/alarm-notify-dialog.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'calendar/gui') diff --git a/calendar/gui/alarm-notify/alarm-notify-dialog.c b/calendar/gui/alarm-notify/alarm-notify-dialog.c index eac9424de3..e409432d3f 100644 --- a/calendar/gui/alarm-notify/alarm-notify-dialog.c +++ b/calendar/gui/alarm-notify/alarm-notify-dialog.c @@ -144,18 +144,20 @@ dialog_response_cb (GtkDialog *dialog, guint response_id, gpointer user_data) if (!funcinfo) { GtkTreeModel *treemodel = gtk_tree_view_get_model (GTK_TREE_VIEW (an->treeview)); - gtk_tree_model_get_iter_first (treemodel, &iter); + if (!gtk_tree_model_get_iter_first (treemodel, &iter)) + return; + gtk_tree_model_get (treemodel, &iter, ALARM_FUNCINFO_COLUMN, &funcinfo, -1); } + g_return_if_fail (funcinfo); + switch (response_id) { case GTK_RESPONSE_CLOSE: case GTK_RESPONSE_DELETE_EVENT: (* funcinfo->func) (ALARM_NOTIFY_CLOSE, -1, funcinfo->func_data); break; } - - return; } static void -- cgit