mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-06-23 19:04:18 +00:00
(fix) safe-guarding against bogus value coming from the quick tables
This commit is contained in:
@@ -6,6 +6,7 @@ Enhancements
|
||||
|
||||
Bug fixes
|
||||
- [web] handle birthday dates before 1970
|
||||
- [web] safe-guarding against bogus value coming from the quick tables
|
||||
|
||||
3.0.1 (2016-02-05)
|
||||
------------------
|
||||
|
||||
@@ -902,17 +902,22 @@ static inline iCalPersonPartStat _userStateInEvent (NSArray *event)
|
||||
state = iCalPersonPartStatOther;
|
||||
|
||||
participants = [event objectAtIndex: eventPartMailsIndex];
|
||||
states = [event objectAtIndex: eventPartStatesIndex];
|
||||
count = 0;
|
||||
max = [participants count];
|
||||
user = [SOGoUser userWithLogin: [event objectAtIndex: eventOwnerIndex]
|
||||
roles: nil];
|
||||
while (state == iCalPersonPartStatOther && count < max)
|
||||
|
||||
// We guard ourself against bogus value coming from the quick tables
|
||||
if ([participants isKindOfClass: [NSArray class]])
|
||||
{
|
||||
if ([user hasEmail: [participants objectAtIndex: count]])
|
||||
state = [[states objectAtIndex: count] intValue];
|
||||
else
|
||||
count++;
|
||||
states = [event objectAtIndex: eventPartStatesIndex];
|
||||
count = 0;
|
||||
max = [participants count];
|
||||
user = [SOGoUser userWithLogin: [event objectAtIndex: eventOwnerIndex]
|
||||
roles: nil];
|
||||
while (state == iCalPersonPartStatOther && count < max)
|
||||
{
|
||||
if ([user hasEmail: [participants objectAtIndex: count]])
|
||||
state = [[states objectAtIndex: count] intValue];
|
||||
else
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
return state;
|
||||
|
||||
Reference in New Issue
Block a user