diff --git a/ChangeLog b/ChangeLog index f07e56ffb..171a82f9e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2012-08-14 Wolfgang Sourdeau + + * OpenChange/MAPIStoreMailFolder.m (- + moveCopyMessagesWithMIDs:andCount:fromFolder:withMIDs:andChangeKeys:wantCopy:): + do not attempt to access targetChangeKeys when NULL, to avoid a + SEGFAULT. + 2012-08-13 Wolfgang Sourdeau * OpenChange/MAPIStoreSOGo.m (sogo_properties_get_uri): removed diff --git a/OpenChange/MAPIStoreMailFolder.m b/OpenChange/MAPIStoreMailFolder.m index 250d8d815..8aea7e359 100644 --- a/OpenChange/MAPIStoreMailFolder.m +++ b/OpenChange/MAPIStoreMailFolder.m @@ -985,14 +985,17 @@ _parseCOPYUID (NSString *line, NSArray **destUIDsP) } /* Update the change keys */ - [self synchroniseCache]; - for (count = 0; count < midCount; count++) + if (targetChangeKeys) { - changeKey = [NSData dataWithBinary: targetChangeKeys[count]]; - messageKey = [NSString stringWithFormat: @"%@.eml", - [destUIDs objectAtIndex: count]]; - [self setChangeKey: changeKey - forMessageWithKey: messageKey]; + [self synchroniseCache]; + for (count = 0; count < midCount; count++) + { + changeKey = [NSData dataWithBinary: targetChangeKeys[count]]; + messageKey = [NSString stringWithFormat: @"%@.eml", + [destUIDs objectAtIndex: count]]; + [self setChangeKey: changeKey + forMessageWithKey: messageKey]; + } } [self postNotificationsForMoveCopyMessagesWithMIDs: srcMids