evolution-mapi r11 - trunk/src/libexchangemapi



Author: msuman
Date: Fri Nov 21 09:16:20 2008
New Revision: 11
URL: http://svn.gnome.org/viewvc/evolution-mapi?rev=11&view=rev

Log:
Fixes for bug #560465 and bug #560764 - two _very_ critical bugs in the current code.

Modified:
   trunk/src/libexchangemapi/ChangeLog
   trunk/src/libexchangemapi/exchange-mapi-cal-utils.c
   trunk/src/libexchangemapi/exchange-mapi-cal-utils.h
   trunk/src/libexchangemapi/exchange-mapi-connection.c

Modified: trunk/src/libexchangemapi/exchange-mapi-cal-utils.c
==============================================================================
--- trunk/src/libexchangemapi/exchange-mapi-cal-utils.c	(original)
+++ trunk/src/libexchangemapi/exchange-mapi-cal-utils.c	Fri Nov 21 09:16:20 2008
@@ -993,9 +993,15 @@
 }
 
 static gboolean
-fetch_server_data_cb (struct mapi_SPropValue_array *properties, const mapi_id_t fid, const mapi_id_t mid, 
-	GSList *streams, GSList *recipients, GSList *attachments, gpointer data) 
+fetch_server_data_cb (FetchItemsCallbackData *item_data, gpointer data) 
 {
+	struct mapi_SPropValue_array *properties = item_data->properties;
+	const mapi_id_t fid = item_data->fid;
+	const mapi_id_t mid = item_data->mid;
+	GSList *streams = item_data->streams;
+	GSList *recipients = item_data->recipients;
+	GSList *attachments = item_data->attachments;
+
 	icalcomponent_kind kind = ICAL_VEVENT_COMPONENT;
 	gchar *filename = g_build_filename (g_get_home_dir (), TEMP_ATTACH_STORE, NULL);
 	gchar *fileuri = g_filename_to_uri (filename, NULL, NULL);
@@ -1236,7 +1242,7 @@
 	g_slist_free(l);
 }
 
-char *
+gchar *
 exchange_mapi_cal_util_camel_helper (struct mapi_SPropValue_array *properties, 
 				   GSList *streams, GSList *recipients, GSList *attachments)
 {

Modified: trunk/src/libexchangemapi/exchange-mapi-cal-utils.h
==============================================================================
--- trunk/src/libexchangemapi/exchange-mapi-cal-utils.h	(original)
+++ trunk/src/libexchangemapi/exchange-mapi-cal-utils.h	Fri Nov 21 09:16:20 2008
@@ -90,7 +90,7 @@
 void
 exchange_mapi_cal_util_generate_globalobjectid (gboolean is_clean, const char *uid, struct SBinary *sb);
 
-char *
+gchar *
 exchange_mapi_cal_util_camel_helper (struct mapi_SPropValue_array *properties, 
 				   GSList *streams, GSList *recipients, GSList *attachments);
 

Modified: trunk/src/libexchangemapi/exchange-mapi-connection.c
==============================================================================
--- trunk/src/libexchangemapi/exchange-mapi-connection.c	(original)
+++ trunk/src/libexchangemapi/exchange-mapi-connection.c	Fri Nov 21 09:16:20 2008
@@ -1345,7 +1345,14 @@
 				exchange_mapi_util_read_generic_stream (&obj_message, properties_array.lpProps[z].ulPropTag, &stream_list);
 
 		mapi_SPropValue_array_named(&obj_message, &properties_array);
+	}
+
+	/* Release the objects so that the callback may use the store. */
+	mapi_object_release(&obj_message);
+	mapi_object_release(&obj_folder);
+	mapi_object_release(&obj_store);
 
+	if (retval == MAPI_E_SUCCESS) {
 		FetchItemsCallbackData *item_data = g_new0 (FetchItemsCallbackData, 1);
 		item_data->fid = fid;
 		item_data->mid = mid;
@@ -1366,9 +1373,11 @@
 	result = TRUE;
 
 cleanup:
-	mapi_object_release(&obj_message);
-	mapi_object_release(&obj_folder);
-	mapi_object_release(&obj_store);
+	if (!result) {
+		mapi_object_release(&obj_message);
+		mapi_object_release(&obj_folder);
+		mapi_object_release(&obj_store);
+	}
 	talloc_free (mem_ctx);
 	LOGNONE();
 	UNLOCK();



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