From 992c95f9a0665fd7481e01f5883d51609b55bf15 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 14 Aug 2012 20:15:15 +0000 Subject: [PATCH] Monotone-Parent: 22a3b958acddeb274e788d95f5da332880c64d78 Monotone-Revision: 1036da510d0360f1e473b578044e95ac7792871f Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-08-14T20:15:15 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 7 +++++++ OpenChange/MAPIStoreMailFolder.m | 17 ++++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) 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