[evolution-patches] 66344 Crash adding Start Date Field to tasks
- From: JP Rosevear <jpr novell com>
- To: evolution-patches ximian com
- Subject: [evolution-patches] 66344 Crash adding Start Date Field to tasks
- Date: Wed, 22 Sep 2004 14:43:55 -0400
With a bogus start date, we would crash because struct tm was empty
during strftime. Fixed end date, completed and due while I was at it
too.
-JP
--
JP Rosevear <jpr novell com>
Novell, Inc.
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2500.2.11
diff -u -p -r1.2500.2.11 ChangeLog
--- ChangeLog 21 Sep 2004 16:12:04 -0000 1.2500.2.11
+++ ChangeLog 22 Sep 2004 18:45:50 -0000
@@ -1,3 +1,15 @@
+2004-09-22 JP Rosevear <jpr novell com>
+
+ Fixes #66344
+
+ * gui/e-cal-model-calendar.c (get_dtend): check for existence of
+ property and null time instead of sending through bad data
+
+ * gui/e-cal-model.c (get_dtstart): ditto
+
+ * gui/e-cal-model-tasks.c (get_completed): ditto
+ (get_due): ditto
+
2004-09-21 JP Rosevear <jpr novell com>
Fixes #60904
Index: gui/e-cal-model.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-cal-model.c,v
retrieving revision 1.44
diff -u -p -r1.44 e-cal-model.c
--- gui/e-cal-model.c 17 Aug 2004 13:35:28 -0000 1.44
+++ gui/e-cal-model.c 22 Sep 2004 18:45:50 -0000
@@ -401,10 +401,16 @@ get_dtstart (ECalModel *model, ECalModel
priv = model->priv;
if (!comp_data->dtstart) {
+ icalproperty *prop;
icaltimezone *zone;
gboolean got_zone = FALSE;
- tt_start = icalcomponent_get_dtstart (comp_data->icalcomp);
+ prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_DTSTART_PROPERTY);
+ if (!prop)
+ return NULL;
+
+ tt_start = icalproperty_get_dtstart (prop);
+
if (icaltime_get_tzid (tt_start)
&& e_cal_get_timezone (comp_data->client, icaltime_get_tzid (tt_start), &zone, NULL))
got_zone = TRUE;
@@ -417,7 +423,7 @@ get_dtstart (ECalModel *model, ECalModel
tt_start = icaltime_from_timet (comp_data->instance_start, tt_start.is_date);
}
- if (!icaltime_is_valid_time (tt_start))
+ if (!icaltime_is_valid_time (tt_start) || icaltime_is_null_time (tt_start))
return NULL;
comp_data->dtstart = g_new0 (ECellDateEditValue, 1);
Index: gui/e-cal-model-calendar.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-cal-model-calendar.c,v
retrieving revision 1.13.6.1
diff -u -p -r1.13.6.1 e-cal-model-calendar.c
--- gui/e-cal-model-calendar.c 21 Sep 2004 16:01:19 -0000 1.13.6.1
+++ gui/e-cal-model-calendar.c 22 Sep 2004 18:45:50 -0000
@@ -112,20 +112,26 @@ ecmc_column_count (ETableModel *etm)
}
static ECellDateEditValue *
-get_dtend (ECalModel *model, ECalModelComponent *comp_data)
+get_dtend (ECalModelCalendar *model, ECalModelComponent *comp_data)
{
struct icaltimetype tt_end;
if (!comp_data->dtend) {
+ icalproperty *prop;
icaltimezone *zone;
gboolean got_zone = FALSE;
- tt_end = icalcomponent_get_dtend (comp_data->icalcomp);
+ prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_DTEND_PROPERTY);
+ if (!prop)
+ return NULL;
+
+ tt_end = icalproperty_get_dtend (prop);
+
if (icaltime_get_tzid (tt_end)
&& e_cal_get_timezone (comp_data->client, icaltime_get_tzid (tt_end), &zone, NULL))
got_zone = TRUE;
- if ((e_cal_model_get_flags (model) & E_CAL_MODEL_FLAGS_EXPAND_RECURRENCES) &&
+ if ((e_cal_model_get_flags (E_CAL_MODEL (model)) & E_CAL_MODEL_FLAGS_EXPAND_RECURRENCES) &&
(e_cal_util_component_has_recurrences (comp_data->icalcomp))) {
if (got_zone)
tt_end = icaltime_from_timet_with_zone (comp_data->instance_end, tt_end.is_date, zone);
@@ -133,7 +139,7 @@ get_dtend (ECalModel *model, ECalModelCo
tt_end = icaltime_from_timet (comp_data->instance_end, tt_end.is_date);
}
- if (!icaltime_is_valid_time (tt_end))
+ if (!icaltime_is_valid_time (tt_end) || icaltime_is_null_time (tt_end))
return NULL;
comp_data->dtend = g_new0 (ECellDateEditValue, 1);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]