[evolution-data-server] ECalRecur: Convert intervals < 1 into the default (1)
- From: Carlos Martín Nieto <cmartin src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] ECalRecur: Convert intervals < 1 into the default (1)
- Date: Wed, 23 Feb 2011 00:44:11 +0000 (UTC)
commit ae8dad07c8c9b842d4f79aaabc611257ea0f0717
Author: Carlos MartÃn Nieto <carlos cmartin tk>
Date: Mon Feb 21 16:55:32 2011 +0100
ECalRecur: Convert intervals < 1 into the default (1)
Negative intervals have been spotted in the wild. An interval lower
than 1 doesn't make any sense and is against the standard, so if we
see one, we replace it by the default interval of 1.
calendar/libecal/e-cal-recur.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/calendar/libecal/e-cal-recur.c b/calendar/libecal/e-cal-recur.c
index 3c30618..11fc119 100644
--- a/calendar/libecal/e-cal-recur.c
+++ b/calendar/libecal/e-cal-recur.c
@@ -996,7 +996,14 @@ e_cal_recur_from_icalproperty (icalproperty *prop, gboolean exception,
ir = icalproperty_get_rrule (prop);
r->freq = ir.freq;
- r->interval = ir.interval;
+
+ if(G_UNLIKELY(ir.interval < 1)){
+ g_warning("Invalid interval in rule %s - using 1\n",
+ icalrecurrencetype_as_string(&ir));
+ r->interval = 1;
+ } else {
+ r->interval = ir.interval;
+ }
r->enddate = e_cal_recur_obtain_enddate (&ir, prop, zone, convert_end_date);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]