[evolution-ews] Bug 660412 - Crash in g_list_reverse,	e_data_cal_respond_send_objects
- From: Chenthill Palanisamy <pchen src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [evolution-ews] Bug 660412 - Crash in g_list_reverse,	e_data_cal_respond_send_objects
 
- Date: Thu, 29 Sep 2011 05:19:18 +0000 (UTC)
 
commit 5599ad5e4656c8d4d403f9ebc439864b0455623b
Author: Chenthill Palanisamy <pchenthill novell com>
Date:   Thu Sep 29 10:48:26 2011 +0530
    Bug 660412 - Crash in g_list_reverse, e_data_cal_respond_send_objects
 src/calendar/libedata-cal-compat.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/src/calendar/libedata-cal-compat.c b/src/calendar/libedata-cal-compat.c
index 040f7fa..ee6fa8e 100644
--- a/src/calendar/libedata-cal-compat.c
+++ b/src/calendar/libedata-cal-compat.c
@@ -40,7 +40,8 @@ e_data_cal_view_notify_objects_added_compat	(EDataCalView *view, const GSList *o
 
 	for (sl = (GSList *) objects; sl != NULL; sl = g_slist_next (sl))
 		l = g_list_prepend (l, sl->data);
-	l = g_list_reverse (l);
+	if (l)
+		l = g_list_reverse (l);
 
 	e_data_cal_view_notify_objects_added (view, (const GList *) l);
 	g_list_free (l);
@@ -85,7 +86,8 @@ e_data_cal_respond_get_object_list	(EDataCal *cal, EServerMethodContext opid, GE
 
 	for (sl = (GSList *) objects; sl != NULL; sl = g_slist_next (sl))
 		l = g_list_prepend (l, sl->data);
-	l = g_list_reverse (l);
+	if (l)
+		l = g_list_reverse (l);
 
 	e_data_cal_notify_object_list (cal, opid, error, l);
 	g_list_free (l);
@@ -119,12 +121,13 @@ e_data_cal_respond_receive_objects	(EDataCal *cal, EServerMethodContext opid, GE
 void
 e_data_cal_respond_send_objects		(EDataCal *cal, EServerMethodContext opid, GError *error, const GSList *users, const gchar *calobj)
 {
-	GList *l;
+	GList *l = NULL;
 	GSList *sl;
 	
 	for (sl = (GSList *) users; sl != NULL; sl = g_slist_next (sl))
 		l = g_list_prepend (l, sl->data);
-	l = g_list_reverse (l);
+	if (l)
+		l = g_list_reverse (l);
 
 
 	e_data_cal_notify_objects_sent	(cal, opid, error, l, calobj);
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]