[evolution-patches] fix for the bug #267330 [calendar]



Hi, 
   Have attached the fix for the bug. Initialized the elements of the
structure, so that it does not cause a crash. 

thanks, Chenthill.
? 267330.diff
? 314925.diff
? 317322_eds.diff
? 319883.diff
? config.guess
? config.sub
? depcomp
? install-sh
? ltmain.sh
? missing
? mkinstalldirs
? temp
? ylwrap
? libecal/.e-cal.c.swo
? libecal/.e-cal.c.swp
? tests/ecal/test-recur
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/ChangeLog,v
retrieving revision 1.530
diff -u -p -r1.530 ChangeLog
--- ChangeLog	28 Nov 2005 19:06:47 -0000	1.530
+++ ChangeLog	30 Nov 2005 13:32:02 -0000
@@ -1,3 +1,19 @@
+2005-11-30  Chenthill Palanisamy  <pchenthill novell com>
+
+	Fixes #267330
+	* backends/file/e-cal-backend-file.c: (sanitize_component),
+	(cancel_received_object), (e_cal_backend_file_receive_objects):
+	* libecal/e-cal-recur.c: (e_cal_recur_generate_instances_of_rule):
+	* libecal/e-cal-util.c: (generate_absolute_triggers):
+	* libecal/e-cal.c: (generate_instances): Intialize the elements in
+	the structure.
+	* libedata-cal/e-cal-backend-sexp.c:
+	(e_cal_backend_sexp_match_object): Initialized the icalcomp and
+	added a warning.
+	* libedata-cal/e-cal-backend.c:
+	(e_cal_backend_notify_object_removed): Ensure the presence of
+	old_object.
+
 2005-11-28  Chenthill Palanisamy  <pchenthill novell com>
 
 	Fixes #317322
Index: backends/file/e-cal-backend-file.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/backends/file/e-cal-backend-file.c,v
retrieving revision 1.67
diff -u -p -r1.67 e-cal-backend-file.c
--- backends/file/e-cal-backend-file.c	28 Nov 2005 19:06:48 -0000	1.67
+++ backends/file/e-cal-backend-file.c	30 Nov 2005 13:32:02 -0000
@@ -1639,6 +1639,10 @@ sanitize_component (ECalBackendFile *cbf
 	ECalComponentDateTime dt;
 	icaltimezone *zone, *default_zone;
 
+	/* initialize */
+	dt.tzid = NULL;
+	dt.value = NULL;
+	
 	/* Check dtstart, dtend and due's timezone, and convert it to local 
 	 * default timezone if the timezone is not in our builtin timezone
 	 * list */
Index: libecal/e-cal-recur.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/libecal/e-cal-recur.c,v
retrieving revision 1.9
diff -u -p -r1.9 e-cal-recur.c
--- libecal/e-cal-recur.c	31 Aug 2005 04:21:54 -0000	1.9
+++ libecal/e-cal-recur.c	30 Nov 2005 13:32:05 -0000
@@ -699,6 +699,12 @@ e_cal_recur_generate_instances_of_rule (
 	g_return_if_fail (start >= -1);
 	g_return_if_fail (end >= -1);
 
+	/* initialize */
+	dtstart.tzid = NULL;
+	dtstart.value = NULL;
+	dtend.tzid = NULL;
+	dtend.value = NULL;
+
 	/* Get dtstart, dtend, recurrences, and exceptions. Note that
 	   cal_component_get_dtend() will convert a DURATION property to a
 	   DTEND so we don't need to worry about that. */
Index: libecal/e-cal-util.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/libecal/e-cal-util.c,v
retrieving revision 1.12
diff -u -p -r1.12 e-cal-util.c
--- libecal/e-cal-util.c	31 Aug 2005 04:21:54 -0000	1.12
+++ libecal/e-cal-util.c	30 Nov 2005 13:32:05 -0000
@@ -438,6 +438,12 @@ generate_absolute_triggers (ECalComponen
 	GList *l;
 	ECalComponentDateTime dt_start, dt_end;
 
+	/* initialize */
+	dt_start.tzid = NULL;
+	dt_start.value = NULL;
+	dt_end.tzid = NULL;
+	dt_end.value = NULL;
+	
 	e_cal_component_get_dtstart (comp, &dt_start);
 	e_cal_component_get_dtend (comp, &dt_end);
 
Index: libecal/e-cal.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/libecal/e-cal.c,v
retrieving revision 1.121
diff -u -p -r1.121 e-cal.c
--- libecal/e-cal.c	24 Oct 2005 08:45:29 -0000	1.121
+++ libecal/e-cal.c	30 Nov 2005 13:32:06 -0000
@@ -3589,6 +3589,12 @@ generate_instances (ECal *ecal, time_t s
 			ECalComponentDateTime dtstart, dtend;
 			icaltimezone *start_zone = NULL, *end_zone = NULL;
 
+			/* initialize */
+			dtstart.tzid = NULL;
+			dtstart.value = NULL;
+			dtend.tzid = NULL;
+			dtend.value = NULL;
+
 			/* keep the detached instances apart */
 			ci = g_new0 (struct comp_instance, 1);
 			ci->comp = comp;
Index: libedata-cal/e-cal-backend-sexp.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/libedata-cal/e-cal-backend-sexp.c,v
retrieving revision 1.21
diff -u -p -r1.21 e-cal-backend-sexp.c
--- libedata-cal/e-cal-backend-sexp.c	6 May 2005 11:22:28 -0000	1.21
+++ libedata-cal/e-cal-backend-sexp.c	30 Nov 2005 13:32:06 -0000
@@ -1068,12 +1068,14 @@ gboolean
 e_cal_backend_sexp_match_object (ECalBackendSExp *sexp, const char *object, ECalBackend *backend)
 {
 	ECalComponent *comp;
-	icalcomponent *icalcomp;
+	icalcomponent *icalcomp = NULL;
 	gboolean retval;
 
 	icalcomp = icalcomponent_new_from_string ((char *) object);
-	if (!icalcomp)
+	if (!icalcomp) {
+		g_warning ("Match object: Failed to create a ical component \n");
 		return FALSE;
+	}
 
 	comp = e_cal_component_new ();
 	e_cal_component_set_icalcomponent (comp, icalcomp);
Index: libedata-cal/e-cal-backend.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/libedata-cal/e-cal-backend.c,v
retrieving revision 1.23
diff -u -p -r1.23 e-cal-backend.c
--- libedata-cal/e-cal-backend.c	11 Oct 2005 07:56:21 -0000	1.23
+++ libedata-cal/e-cal-backend.c	30 Nov 2005 13:32:07 -0000
@@ -1303,6 +1303,8 @@ e_cal_backend_notify_object_removed (ECa
 
 	priv = backend->priv;
 
+	g_return_if_fail (old_object != NULL);
+
 	if (priv->notification_proxy) {
 		e_cal_backend_notify_object_removed (priv->notification_proxy, id, old_object, object);
 		return;
? 244981.diff
? 246480.diff
? 273847.diff
? 301391.diff
? 308802.diff
? 313538.diff
? 315095.diff
? 316954.diff
? 317322.diff
? 317322_evo.diff
? 321088.diff
? 321739.diff
? 322616.diff
? calendar.error
? evo.diff
? temp
? conduits/memo/Makefile
? conduits/memo/Makefile.in
? gui/apps_evolution_calendar-2.4.schemas
? gui/apps_evolution_calendar-2.6.schemas
? gui/temp
? gui/alarm-notify/temp
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2860
diff -u -p -r1.2860 ChangeLog
--- ChangeLog	29 Nov 2005 08:15:07 -0000	1.2860
+++ ChangeLog	30 Nov 2005 13:04:37 -0000
@@ -1,3 +1,24 @@
+2005-11-30  Chenthill Palanisamy  <pchenthill novell com>
+
+	* conduits/calendar/calendar-conduit.c: (process_multi_day),
+	(local_record_from_comp):
+	* gui/comp-util.c: (cal_comp_util_compare_event_timezones):
+	* gui/dialogs/comp-editor-util.c: (comp_editor_dates):
+	* gui/dialogs/event-page.c: (event_page_fill_widgets):
+	* gui/dialogs/recurrence-page.c: (get_start_weekday_mask),
+	(preview_recur), (make_ending_until_special):
+	* gui/dialogs/schedule-page.c: (schedule_page_fill_widgets):
+	* gui/dialogs/task-page.c: (task_page_fill_widgets):
+	* gui/e-cal-component-preview.c: (write_html):
+	* gui/e-cal-list-view.c: (e_cal_list_view_get_selected_time_range):
+	* gui/e-calendar-table.c: (task_compare_cb):
+	* gui/e-calendar-view.c:
+	(e_calendar_view_delete_selected_occurrence):
+	* gui/e-itip-control.c: (set_date_label):
+	* gui/itip-utils.c: (comp_description):
+	* gui/print.c: (print_date_label): Initialize the members of the 
+	ECalComponentDateTime.
+
 2005-11-29  Chenthill Palanisamy  <pchenthill novell com>
 
 	Fixes #322616
Index: conduits/calendar/calendar-conduit.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/conduits/calendar/calendar-conduit.c,v
retrieving revision 1.129
diff -u -p -r1.129 calendar-conduit.c
--- conduits/calendar/calendar-conduit.c	30 Sep 2005 17:13:04 -0000	1.129
+++ conduits/calendar/calendar-conduit.c	30 Nov 2005 13:04:37 -0000
@@ -585,6 +585,12 @@ process_multi_day (ECalConduitContext *c
 	if (ccc->type == E_CAL_CHANGE_DELETED)
 		return FALSE;
 
+	/* initialize */
+	dt_start.tzid = NULL;
+	dt_start.value =NULL;
+	dt_end.tzid = NULL;
+	dt_end.value = NULL:
+	
 	/* Start time */
 	e_cal_component_get_dtstart (ccc->comp, &dt_start);
 	if (dt_start.value->is_date)
@@ -808,6 +814,12 @@ local_record_from_comp (ECalLocalRecord 
 	local->comp = comp;
 	g_object_ref (comp);
 	
+	/* initialize */
+	dt_start.tzid = NULL;
+	dt_start.value =NULL;
+	dt_end.tzid = NULL;
+	dt_end.value = NULL:
+
 	e_cal_component_get_uid (local->comp, &uid);
 	local->local.ID = e_pilot_map_lookup_pid (ctxt->map, uid, TRUE);
 	compute_status (ctxt, local, uid);
Index: gui/comp-util.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/comp-util.c,v
retrieving revision 1.28
diff -u -p -r1.28 comp-util.c
--- gui/comp-util.c	19 Oct 2005 11:39:33 -0000	1.28
+++ gui/comp-util.c	30 Nov 2005 13:04:37 -0000
@@ -102,6 +102,12 @@ cal_comp_util_compare_event_timezones (E
 	icaltimezone *start_zone, *end_zone;
 	int offset1, offset2;
 
+	/* initialize */
+	start_datetime.tzid = NULL;
+	start_datetime.value = NULL;
+	end_datetime.tzid = NULL;
+	end_datetime.value = NULL;
+	
 	tzid = icaltimezone_get_tzid (zone);
 
 	e_cal_component_get_dtstart (comp, &start_datetime);
Index: gui/e-cal-component-preview.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-cal-component-preview.c,v
retrieving revision 1.5
diff -u -p -r1.5 e-cal-component-preview.c
--- gui/e-cal-component-preview.c	24 Nov 2005 15:11:49 -0000	1.5
+++ gui/e-cal-component-preview.c	30 Nov 2005 13:04:37 -0000
@@ -142,6 +142,10 @@ write_html (GtkHTMLStream *stream, ECal 
 
 	g_return_if_fail (E_IS_CAL_COMPONENT (comp));
 
+	/* initialize */
+	dt.tzid = NULL;
+	dt.value = NULL;
+
 	/* write document header */
 	e_cal_component_get_summary (comp, &text);
 
Index: gui/e-cal-list-view.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-cal-list-view.c,v
retrieving revision 1.20
diff -u -p -r1.20 e-cal-list-view.c
--- gui/e-cal-list-view.c	26 Nov 2005 02:31:48 -0000	1.20
+++ gui/e-cal-list-view.c	30 Nov 2005 13:04:38 -0000
@@ -440,6 +440,12 @@ e_cal_list_view_get_selected_time_range 
 		ECalComponentDateTime dtstart, dtend;
 		ECalComponent *comp;
 
+		/* initialize */
+		dtstart.tzid = NULL;
+		dtstart.value = NULL;
+		dtend.tzid = NULL;
+		dtend.value = NULL;
+
 		comp = e_cal_component_new ();
 		e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
 		if (start_time) {
Index: gui/e-calendar-table.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-calendar-table.c,v
retrieving revision 1.145
diff -u -p -r1.145 e-calendar-table.c
--- gui/e-calendar-table.c	26 Nov 2005 02:31:48 -0000	1.145
+++ gui/e-calendar-table.c	30 Nov 2005 13:04:40 -0000
@@ -178,6 +178,13 @@ task_compare_cb (gconstpointer a, gconst
 	ca = E_CAL_COMPONENT (a);
 	cb = E_CAL_COMPONENT (b);
 
+	/* initialize */
+	due_a.tzid = NULL;
+	due_a.value = NULL;
+	due_b.value = NULL;
+	due_b.tzid = NULL;
+	
+
 	e_cal_component_get_due (ca, &due_a);
 	e_cal_component_get_due (cb, &due_b);
 	e_cal_component_get_priority (ca, &prio_a);
Index: gui/e-calendar-view.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-calendar-view.c,v
retrieving revision 1.101
diff -u -p -r1.101 e-calendar-view.c
--- gui/e-calendar-view.c	28 Nov 2005 19:05:24 -0000	1.101
+++ gui/e-calendar-view.c	30 Nov 2005 13:04:42 -0000
@@ -962,6 +962,10 @@ e_calendar_view_delete_selected_occurren
 		icaltimezone *zone = NULL;
 		gboolean is_instance = FALSE;
 
+		/* initialize */
+		dt.tzid = NULL;
+		dt.value = NULL;
+		
 		e_cal_component_get_uid (comp, &uid);
 		e_cal_component_get_dtstart (comp, &dt);
 		is_instance = e_cal_component_is_instance (comp);
@@ -990,6 +994,9 @@ e_calendar_view_delete_selected_occurren
 					comp, TRUE) && !e_cal_get_save_schedules (event->comp_data->client)) {
 			if (!e_cal_component_is_instance (comp)) {
 				ECalComponentRange range;
+
+				range.datetime.tzid = NULL;
+				range.datetime.value = NULL;
 
 				/* set the recurrence ID of the object we send */
 				range.type = E_CAL_COMPONENT_RANGE_SINGLE;
Index: gui/e-itip-control.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-itip-control.c,v
retrieving revision 1.170
diff -u -p -r1.170 e-itip-control.c
--- gui/e-itip-control.c	25 Nov 2005 04:12:03 -0000	1.170
+++ gui/e-itip-control.c	30 Nov 2005 13:04:44 -0000
@@ -855,6 +855,10 @@ set_date_label (EItipControl *itip, GtkH
 
 	type = e_cal_component_get_vtype (comp);
 
+	/* initialize */
+	datetime.tzid = NULL;
+	datetime.value = NULL;
+	
 	buffer[0] = '\0';
 	e_cal_component_get_dtstart (comp, &datetime);
 	if (datetime.value) {
Index: gui/itip-utils.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/itip-utils.c,v
retrieving revision 1.109
diff -u -p -r1.109 itip-utils.c
--- gui/itip-utils.c	25 Nov 2005 04:12:04 -0000	1.109
+++ gui/itip-utils.c	30 Nov 2005 13:04:45 -0000
@@ -625,6 +625,10 @@ comp_description (ECalComponent *comp)
         ECalComponentDateTime dt;
         char *start = NULL, *end = NULL;
 
+	/* initialize */
+	dt.tzid = NULL;
+	dt.value = NULL;
+
         switch (e_cal_component_get_vtype (comp)) {
         case E_CAL_COMPONENT_EVENT:
                 return CORBA_string_dup (_("Event information"));
Index: gui/print.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/print.c,v
retrieving revision 1.77
diff -u -p -r1.77 print.c
--- gui/print.c	24 Nov 2005 15:11:49 -0000	1.77
+++ gui/print.c	30 Nov 2005 13:04:48 -0000
@@ -2223,6 +2223,10 @@ print_date_label (GnomePrintContext *pc,
 	time_t start = 0, end = 0, complete = 0, due = 0;
 	static char buffer[1024];
 
+	/* initialize */
+	datetime.tzid = NULL;
+	datetime.value = NULL;
+	   
 	e_cal_component_get_dtstart (comp, &datetime);
 	if (datetime.value) {
 		start_zone = get_zone_from_tzid (client, datetime.tzid);
Index: gui/dialogs/comp-editor-util.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/comp-editor-util.c,v
retrieving revision 1.34
diff -u -p -r1.34 comp-editor-util.c
--- gui/dialogs/comp-editor-util.c	24 Nov 2005 15:11:50 -0000	1.34
+++ gui/dialogs/comp-editor-util.c	30 Nov 2005 13:04:48 -0000
@@ -57,6 +57,8 @@ comp_editor_dates (CompEditorPageDates *
 	dates->end = NULL;
 	dates->due = NULL;
 	dates->complete = NULL;
+	dt.tzid = NULL;
+	dt.value = NULL;
 	
 	/* Note that the ECalComponentDateTime's returned contain allocated
 	   icaltimetype and tzid values, so we just take over ownership of
Index: gui/dialogs/event-page.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/event-page.c,v
retrieving revision 1.92
diff -u -p -r1.92 event-page.c
--- gui/dialogs/event-page.c	26 Nov 2005 02:39:46 -0000	1.92
+++ gui/dialogs/event-page.c	30 Nov 2005 13:04:48 -0000
@@ -927,6 +927,12 @@ event_page_fill_widgets (CompEditorPage 
 	epage = EVENT_PAGE (page);
 	priv = epage->priv;
 
+	/* initiaze */
+	start_date.tzid = NULL;
+	start_date.value = NULL;
+	end_date.tzid = NULL;
+	end_date.value = NULL;
+
 	if (!e_cal_component_has_organizer (comp)) 
 		page->flags |= COMP_EDITOR_PAGE_USER_ORG;
 
@@ -948,10 +954,6 @@ event_page_fill_widgets (CompEditorPage 
 	clear_widgets (epage);
 
 	/* Summary, location, description(s) */
-
-	/* Component for cancellation */
-	priv->comp = e_cal_component_clone (comp);
-	
 	e_cal_component_get_summary (comp, &text);
 	e_dialog_editable_set (priv->summary, text.value);
 	priv->old_summary = g_strdup (text.value);
Index: gui/dialogs/recurrence-page.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/recurrence-page.c,v
retrieving revision 1.71
diff -u -p -r1.71 recurrence-page.c
--- gui/dialogs/recurrence-page.c	26 Nov 2005 02:31:52 -0000	1.71
+++ gui/dialogs/recurrence-page.c	30 Nov 2005 13:04:49 -0000
@@ -433,6 +433,10 @@ get_start_weekday_mask (ECalComponent *c
 	ECalComponentDateTime dt;
 	guint8 retval;
 
+	/* initialize */
+	dt.tzid = NULL;
+	dt.value = NULL;
+
 	e_cal_component_get_dtstart (comp, &dt);
 
 	if (dt.value) {
@@ -850,13 +854,18 @@ preview_recur (RecurrencePage *rpage)
 	/* If our component has not been set yet through ::fill_widgets(), we
 	 * cannot preview the recurrence.
 	 */
-	if (!priv->comp || e_cal_component_is_instance (priv->comp))
+	if (!priv->comp || e_cal_component_is_instance (priv->comp) || 
+			!e_cal_component_get_icalcomponent (priv->comp))
 		return;
 
+	/* initialize */
+	cdt.tzid = NULL;
+	cdt.value = NULL;
+
 	/* Create a scratch component with the start/end and
 	 * recurrence/exception information from the one we are editing.
 	 */
-
+	
 	comp = e_cal_component_new ();
 	e_cal_component_set_new_vtype (comp, E_CAL_COMPONENT_EVENT);
 
@@ -1304,6 +1313,11 @@ make_ending_until_special (RecurrencePag
 	g_assert (GTK_BIN (priv->ending_special)->child == NULL);
 	g_assert (priv->ending_date_edit == NULL);
 
+	
+	/* initialize */
+	dt_start.tzid = NULL;
+	dt_start.value = NULL;
+	   
 	/* Create the widget */
 
 	priv->ending_date_edit = comp_editor_new_date_edit (TRUE, FALSE,
Index: gui/dialogs/schedule-page.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/schedule-page.c,v
retrieving revision 1.37
diff -u -p -r1.37 schedule-page.c
--- gui/dialogs/schedule-page.c	26 Nov 2005 02:31:52 -0000	1.37
+++ gui/dialogs/schedule-page.c	30 Nov 2005 13:04:49 -0000
@@ -294,6 +294,12 @@ schedule_page_fill_widgets (CompEditorPa
 
 	priv->updating = TRUE;
 
+	/* initialize */
+	start_date.tzid = NULL;
+	start_date.value = NULL;
+	end_date.tzid = NULL;
+	end_date.value = NULL;
+
 	/* Clean the screen */
 	clear_widgets (spage);
 
Index: gui/dialogs/task-page.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/task-page.c,v
retrieving revision 1.77
diff -u -p -r1.77 task-page.c
--- gui/dialogs/task-page.c	26 Nov 2005 02:31:52 -0000	1.77
+++ gui/dialogs/task-page.c	30 Nov 2005 13:04:50 -0000
@@ -523,6 +523,10 @@ task_page_fill_widgets (CompEditorPage *
 
 	priv->updating = TRUE;
 
+	/* initialize */
+	d.tzid = NULL;
+	d.value = NULL;
+
 	/* Clean out old data */
 	if (priv->comp != NULL)
 		g_object_unref (priv->comp);


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