[evolution-mapi] Bug #595260 - crash in mapi_sync_deleted



commit fc2e9ea5b29a6fa345073c92275e4c3f9c328e81
Author: Milan Crha <mcrha redhat com>
Date:   Wed Sep 23 14:08:55 2009 +0200

    Bug #595260 - crash in mapi_sync_deleted

 src/camel/camel-mapi-folder.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/camel/camel-mapi-folder.c b/src/camel/camel-mapi-folder.c
index 13da8c3..0fd5e33 100644
--- a/src/camel/camel-mapi-folder.c
+++ b/src/camel/camel-mapi-folder.c
@@ -702,7 +702,6 @@ mapi_sync_deleted (CamelSession *session, CamelSessionThreadMsg *msg)
 	guint32 index, count, options = 0;
 	GSList *server_uid_list = NULL;
 	const gchar *uid = NULL;
-	GSList *tmp_list_item = NULL;
 
 	/* Currently we don't have simple wrapper over getprops.*/
 	const guint32 prop_list[] = { PR_LAST_MODIFICATION_TIME };
@@ -739,6 +738,8 @@ mapi_sync_deleted (CamelSession *session, CamelSessionThreadMsg *msg)
 
 	/* Iterate over cache and check if the UID is in server*/
 	for (index = 0; index < count; index++) {
+		GSList *tmp_list_item = NULL;
+
 		/*FIXME :Any other list available ???*/
 		info = camel_folder_summary_index (m->folder->summary, index);
 		if (!info) continue; /*This is bad. *Should* not happen*/
@@ -752,7 +753,7 @@ mapi_sync_deleted (CamelSession *session, CamelSessionThreadMsg *msg)
 		}
 
 		/* If it is not in server list, clean our cache */
-		if (!tmp_list_item->data && uid) {
+		if ((!tmp_list_item || !tmp_list_item->data) && uid) {
 			CAMEL_MAPI_FOLDER_REC_LOCK (m->folder, cache_lock);
 			camel_folder_summary_remove_uid (m->folder->summary, uid);
 			camel_data_cache_remove (mapi_folder->cache, "cache", uid, NULL);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]