From ef6aab63c900f7fe3d6ee2b00c540a4e54e3b286 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Amor=20Garc=C3=ADa?= Date: Mon, 23 Feb 2015 15:21:16 +0100 Subject: [PATCH] oc-calendar: Don't change event recurrence if parse failed. get_AppointmentRecurrencePattern() can fail to parse the input data, added a check to avoid setup the recurrence pattern in that case. This should only happen when input data is incorrect. --- OpenChange/iCalEvent+MAPIStore.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/OpenChange/iCalEvent+MAPIStore.m b/OpenChange/iCalEvent+MAPIStore.m index 1c94b8ee3..ee1b0d6ec 100644 --- a/OpenChange/iCalEvent+MAPIStore.m +++ b/OpenChange/iCalEvent+MAPIStore.m @@ -81,6 +81,12 @@ blob = [mapiRecurrenceData asBinaryInMemCtx: memCtx]; pattern = get_AppointmentRecurrencePattern (memCtx, blob); + + if (pattern == NULL) { + [self logWithFormat: @"Error parsing recurrence pattern. No changes in event recurrence will be done"]; + return; + } + [(iCalCalendar *) parent setupRecurrenceWithMasterEntity: self fromRecurrencePattern: &pattern->RecurrencePattern];