[evolution-patches] [e-d-s] e-cal.c fixes 56517



Hi,

Added a check for the icalcomponent. This was getting NULL for some corrupted zone. Please let me know if this is fine to be committed.

Regards
Sarfraaz Ahmed
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/ChangeLog,v
retrieving revision 1.238
diff -u -r1.238 ChangeLog
--- ChangeLog	6 Apr 2004 12:24:31 -0000	1.238
+++ ChangeLog	8 Apr 2004 07:15:31 -0000
@@ -1,3 +1,10 @@
+2004-04-08  Sarfraaz Ahmed <asarfraaz novell com>
+
+	Fixes #56517
+	
+	* libecal/e-cal.c (e_cal_add_timezone): Added a check for icalcomponent
+	structure. Return FALSE if icalcomponent is NULL.
+
 2004-04-06  Harish K <kharish novell com>
 	
 	Fixes #55169
Index: libecal/e-cal.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/libecal/e-cal.c,v
retrieving revision 1.53
diff -u -r1.53 e-cal.c
--- libecal/e-cal.c	31 Mar 2004 14:45:32 -0000	1.53
+++ libecal/e-cal.c	8 Apr 2004 07:16:13 -0000
@@ -3776,10 +3776,15 @@
 	ECalendarStatus status;
 	ECalendarOp *our_op;
 	const char *tzobj;
+	icalcomponent *icalcomp;
 
 	e_return_error_if_fail (ecal && E_IS_CAL (ecal), E_CALENDAR_STATUS_INVALID_ARG);
 	e_return_error_if_fail (izone, E_CALENDAR_STATUS_INVALID_ARG);
+	
+	icalcomp = icaltimezone_get_component (izone);
 
+	e_return_error_if_fail (icalcomp, FALSE);
+	
 	priv = ecal->priv;
 
 	g_mutex_lock (priv->mutex);
@@ -3801,7 +3806,7 @@
 	g_mutex_unlock (priv->mutex);
 
 	/* convert icaltimezone into a string */
-	tzobj = icalcomponent_as_ical_string (icaltimezone_get_component (izone));
+	tzobj = icalcomponent_as_ical_string (icalcomp);
 
 	/* call the backend */
 	CORBA_exception_init (&ev);


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