[evolution/webkit] Bug #652620 - Can use uninitialized memory in alarm-notification-dialog



commit 454063f3756e511aead728ab99a1cd6ef5614045
Author: Milan Crha <mcrha redhat com>
Date:   Wed Jun 15 11:37:10 2011 +0200

    Bug #652620 - Can use uninitialized memory in alarm-notification-dialog

 calendar/gui/alarm-notify/alarm-notify-dialog.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/calendar/gui/alarm-notify/alarm-notify-dialog.c b/calendar/gui/alarm-notify/alarm-notify-dialog.c
index eac9424..e409432 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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]