prevent potential freebusy lookup crashes during timezone changes with repetitive events
parent
baf3d1f986
commit
9eb138b867
1
NEWS
1
NEWS
|
@ -23,6 +23,7 @@ Bug fixes
|
|||
- fixed EAS handling of Bcc in emails (#3138)
|
||||
- fixed Language-Region tags in Web interface (#3121)
|
||||
- properly fallback over EAS to UTF-8 and then Latin1 for messages w/o charset (#3103)
|
||||
- prevent potential freebusy lookup crashes during timezone changes with repetitive events
|
||||
|
||||
2.2.16 (2015-02-12)
|
||||
-------------------
|
||||
|
|
|
@ -155,6 +155,7 @@
|
|||
|
||||
delta = [[currentDate timeZoneDetail] timeZoneSecondsFromGMT] - [[startDate timeZoneDetail] timeZoneSecondsFromGMT];
|
||||
startInterval += (delta/60/15);
|
||||
startInterval = (startInterval < -4 ? -4 : startInterval);
|
||||
|
||||
currentDate = [record objectForKey: @"endDate"];
|
||||
if ([currentDate earlierDate: endDate] == endDate)
|
||||
|
@ -165,6 +166,8 @@
|
|||
|
||||
delta = [[currentDate timeZoneDetail] timeZoneSecondsFromGMT] - [[startDate timeZoneDetail] timeZoneSecondsFromGMT];
|
||||
endInterval += (delta/60/15);
|
||||
endInterval = (endInterval < 0 ? 0 : endInterval);
|
||||
endInterval = (endInterval > itemCount+4 ? itemCount+4 : endInterval);
|
||||
|
||||
// Update bit string representation
|
||||
// If the user is a resource with restristed amount of bookings, keep the sum of overlapping events
|
||||
|
@ -230,7 +233,7 @@
|
|||
intervals = interval / intervalSeconds + 8;
|
||||
|
||||
// Build a bit string representation of the freebusy data for the period
|
||||
freeBusyItems = NSZoneCalloc (NULL, intervals, sizeof (int));
|
||||
freeBusyItems = calloc(intervals, sizeof (unsigned int));
|
||||
[self _fillFreeBusyItems: (freeBusyItems+4)
|
||||
count: (intervals-4)
|
||||
withRecords: [fb fetchFreeBusyInfosFrom: start to: end forContact: uid]
|
||||
|
@ -243,7 +246,7 @@
|
|||
{
|
||||
[freeBusy addObject: [NSString stringWithFormat: @"%d", *(freeBusyItems + count)]];
|
||||
}
|
||||
NSZoneFree (NULL, freeBusyItems);
|
||||
free(freeBusyItems);
|
||||
|
||||
// Return a NSString representation
|
||||
return [freeBusy componentsJoinedByString: @","];
|
||||
|
|
Loading…
Reference in New Issue