From 59c61f49856291cc6cfd821533da16848d4a1e06 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Thu, 18 Aug 2011 17:29:42 +0200 Subject: Bug #656810 - Too strict checking for validity of received calendars --- calendar/gui/itip-utils.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'calendar/gui') 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; } -- cgit