aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2011-08-18 23:29:42 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-09-14 20:08:51 +0800
commitdd3128f8b76dac434f202c7ea68a333988fff372 (patch)
tree0719e762c8c36e55460e925adb8b39b03695a87c /calendar
parent50165add499b92a1ca4be5bb866d1608e53f1878 (diff)
downloadgsoc2013-evolution-dd3128f8b76dac434f202c7ea68a333988fff372.tar.gz
gsoc2013-evolution-dd3128f8b76dac434f202c7ea68a333988fff372.tar.zst
gsoc2013-evolution-dd3128f8b76dac434f202c7ea68a333988fff372.zip
Bug #656810 - Too strict checking for validity of received calendars
Diffstat (limited to 'calendar')
-rw-r--r--calendar/gui/itip-utils.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/calendar/gui/itip-utils.c b/calendar/gui/itip-utils.c
index 02042d29a9..19f01614c6 100644
--- a/calendar/gui/itip-utils.c
+++ b/calendar/gui/itip-utils.c
@@ -2026,8 +2026,22 @@ check_time (const struct icaltimetype tmval,
gboolean
is_icalcomp_valid (icalcomponent *icalcomp)
{
- return icalcomp &&
- icalcomponent_is_valid (icalcomp) &&
- check_time (icalcomponent_get_dtstart (icalcomp), FALSE) &&
- check_time (icalcomponent_get_dtend (icalcomp), TRUE);
+ if (!icalcomp || !icalcomponent_is_valid (icalcomp))
+ return FALSE;
+
+ switch (icalcomponent_isa (icalcomp)) {
+ case ICAL_VEVENT_COMPONENT:
+ return check_time (icalcomponent_get_dtstart (icalcomp), FALSE) &&
+ check_time (icalcomponent_get_dtend (icalcomp), TRUE);
+ case ICAL_VTODO_COMPONENT:
+ return check_time (icalcomponent_get_dtstart (icalcomp), TRUE) &&
+ check_time (icalcomponent_get_due (icalcomp), TRUE);
+ case ICAL_VJOURNAL_COMPONENT:
+ return check_time (icalcomponent_get_dtstart (icalcomp), TRUE) &&
+ check_time (icalcomponent_get_dtend (icalcomp), TRUE);
+ default:
+ break;
+ }
+
+ return TRUE;
}