[evolution-data-server] Bug 612667 - Crash in imapx_connect_to_server at camel-imapx-server.c:2148



commit b2c4f18f85d1376d69198efa2807e0aa5e1e8467
Author: Chenthill Palanisamy <pchenthill novell com>
Date:   Fri Mar 12 13:52:01 2010 +0530

    Bug 612667 - Crash in imapx_connect_to_server at camel-imapx-server.c:2148

 camel/providers/imapx/camel-imapx-folder.c |    4 ++++
 camel/providers/imapx/camel-imapx-server.c |    4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/camel/providers/imapx/camel-imapx-folder.c b/camel/providers/imapx/camel-imapx-folder.c
index 2b2552d..b2de265 100644
--- a/camel/providers/imapx/camel-imapx-folder.c
+++ b/camel/providers/imapx/camel-imapx-folder.c
@@ -151,10 +151,14 @@ static void
 imapx_sync (CamelFolder *folder, gboolean expunge, CamelException *ex)
 {
 	CamelIMAPXStore *is = (CamelIMAPXStore *)folder->parent_store;
+	CamelException eex = CAMEL_EXCEPTION_INITIALISER;
 
 	if (CAMEL_OFFLINE_STORE (is)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL)
 		return;
 
+	if (!ex)
+		ex = &eex;
+
 	if (is->server && camel_imapx_server_connect (is->server, TRUE, ex))
 		camel_imapx_server_sync_changes (is->server, folder, ex);
 
diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
index 1c57c78..2024116 100644
--- a/camel/providers/imapx/camel-imapx-server.c
+++ b/camel/providers/imapx/camel-imapx-server.c
@@ -2145,12 +2145,12 @@ imapx_connect_to_server (CamelIMAPXServer *is, CamelException *ex)
 
 	hints.ai_socktype = SOCK_STREAM;
 	ai = camel_getaddrinfo(is->url->host, serv, &hints, ex);
-	if (ex->id && ex->id != CAMEL_EXCEPTION_USER_CANCEL && port != NULL) {
+	if (ex && ex->id && ex->id != CAMEL_EXCEPTION_USER_CANCEL && port != NULL) {
 		camel_exception_clear(ex);
 		ai = camel_getaddrinfo(is->url->host, port, &hints, ex);
 	}
 
-	if (ex->id) {
+	if (ex && ex->id) {
 		e(printf ("Unable to connect %d %s \n", ex->id, ex->desc));
 		camel_object_unref(tcp_stream);
 		return FALSE;



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