Fix OOM when having a lot of recurrence rules

We had a broken client that created calendar entries with a lot of
recurrence rule (all of them FREQ=WEEKLY) and a lot of alarms. This led
to SOGo going out of memory.

This patch works around that by filtering out duplicated rules as they
yield the same date ranges and we only need to have them once.
This commit is contained in:
Janne Heß
2022-10-17 20:29:59 +02:00
parent 5fb82fe414
commit 20e4dced40

View File

@@ -1358,7 +1358,9 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir
rules = [component recurrenceRulesWithTimeZone: tz];
exRules = [component exceptionRulesWithTimeZone: tz];
}
rules = [rules uniqueObjects];
// Calculate the occurrences for the given range
records = [NSMutableArray array];
ranges =