From 62b16f4ef35202cbaf37a43f54e589bd051f902d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrique=20J=2E=20Hern=C3=A1ndez=20Blasco?= Date: Mon, 29 Jun 2015 23:50:55 +0200 Subject: [PATCH] oc: Check PidTagObjectType before dereferencing on ModifyRecipients This is crashing when the PidTagObjectType property is set for some recipient and not for others. If the property is missing, then no object type for the recipient is assumed. --- OpenChange/MAPIStoreMessage.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/OpenChange/MAPIStoreMessage.m b/OpenChange/MAPIStoreMessage.m index 1613171ea..b842b2d6c 100644 --- a/OpenChange/MAPIStoreMessage.m +++ b/OpenChange/MAPIStoreMessage.m @@ -202,7 +202,8 @@ rtf2html (NSData *compressedRTF) email = recipient->data[count]; break; case PidTagObjectType: - object_type = *((uint8_t*) recipient->data[count]); + if (recipient->data[count]) + object_type = *((uint8_t*) recipient->data[count]); break; case PidTagSmtpAddress: smtpAddress = recipient->data[count]; @@ -229,7 +230,7 @@ rtf2html (NSData *compressedRTF) if (object_type == MAPI_MAILUSER && recipient->username) { - /* values from user object have priority uppon the data passed for the client */ + /* values from user object have priority over data sent by the client */ recipientUser = [SOGoUser userWithLogin: [value lowercaseString]]; if (recipientUser) {