[evolution-data-server] Crash on bogus component removal in file calendar backend



commit 781f53b73edc8d1ebfc3dbe28d2023e95dc6c01e
Author: Milan Crha <mcrha redhat com>
Date:   Mon Jan 10 13:58:27 2011 +0100

    Crash on bogus component removal in file calendar backend

 calendar/backends/file/e-cal-backend-file.c |   21 ++++++---------------
 1 files changed, 6 insertions(+), 15 deletions(-)
---
diff --git a/calendar/backends/file/e-cal-backend-file.c b/calendar/backends/file/e-cal-backend-file.c
index 0adda60..5c65598 100644
--- a/calendar/backends/file/e-cal-backend-file.c
+++ b/calendar/backends/file/e-cal-backend-file.c
@@ -547,9 +547,9 @@ add_component_to_intervaltree (ECalBackendFile *cbfile, ECalComponent *comp)
 static gboolean
 remove_component_from_intervaltree (ECalBackendFile *cbfile, ECalComponent *comp)
 {
-	time_t time_start = -1, time_end = -1;
 	const gchar *uid = NULL;
 	gchar *rid;
+	gboolean res;
 	ECalBackendFilePrivate *priv;
 
 	g_return_val_if_fail (cbfile != NULL, FALSE);
@@ -557,21 +557,12 @@ remove_component_from_intervaltree (ECalBackendFile *cbfile, ECalComponent *comp
 
 	priv = cbfile->priv;
 
-	e_cal_util_get_component_occur_times (comp, &time_start, &time_end,
-				   resolve_tzid, priv->icalcomp, priv->default_zone,
-				   e_cal_backend_get_kind (E_CAL_BACKEND (cbfile)));
+	rid = e_cal_component_get_recurid_as_string (comp);
+	e_cal_component_get_uid (comp, &uid);
+	res = e_intervaltree_remove (priv->interval_tree, uid, rid);
+	g_free (rid);
 
-	if (time_end != -1 && time_start > time_end) {
-		g_error ("Bogus component %s\n", e_cal_component_get_as_string (comp));
-		return FALSE;
-	} else {
-		gboolean res;
-		rid = e_cal_component_get_recurid_as_string (comp);
-		e_cal_component_get_uid (comp, &uid);
-		res = e_intervaltree_remove (priv->interval_tree, uid, rid);
-		g_free (rid);
-		return res;
-	}
+	return res;
 }
 
 /* Tries to add an icalcomponent to the file backend.  We only store the objects



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