Re: [evolution-patches] Patch for a crash on solaris



Yes. If a temporay variable is introduced, it can be more efficient.
Attached is new patch.

On Thu, 2005-11-10 at 15:09 +0530, Parthasarathi Susarla wrote:
> I fell that it would better to use a variable (temporary) to store the
> description string, and use it. 
> Although am not sure how the compiler would optimise it though.
> -partha
> 
> On Thu, 2005-11-10 at 17:33 +0800, jeff cai wrote:
> > Hi
> > Please review the patch.
> > 
> > On solairs, the parameter of printf can't be 'NULL',
> > 
> > for function camel_exception_get_description (ex), 
> > when ex is 'NULL', the function also returns NULL.
> > Therefore, evolution will crash. I add a condition choice
> > to solve the problem.
> > 
> > Jeff Cai
> > 
> > _______________________________________________
> > Evolution-patches mailing list
> > Evolution-patches gnome org
> > http://mail.gnome.org/mailman/listinfo/evolution-patches
> 
> _______________________________________________
> Evolution-patches mailing list
> Evolution-patches gnome org
> http://mail.gnome.org/mailman/listinfo/evolution-patches
-- 
jeff cai <jeff cai sun com>
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/providers/imap/ChangeLog,v
retrieving revision 1.40
diff -u -r1.40 ChangeLog
--- ChangeLog	21 Oct 2005 07:09:11 -0000	1.40
+++ ChangeLog	10 Nov 2005 10:09:12 -0000
@@ -1,3 +1,8 @@
+2005-11-10  Jeff Cai  <jeff cai sun com>
+
+	* camel-imap-store.c: (imap_auth_loop):
+	On solaris, the string parameter of g_strdup_printf can't be NULL.
+
 2005-10-21 Shreyas Srinivasan <sshreyas novell com>
 
 	* camel-imap-utils.c:(imap_parse_list_response): Handle
Index: camel-imap-store.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/providers/imap/camel-imap-store.c,v
retrieving revision 1.334
diff -u -r1.334 camel-imap-store.c
--- camel-imap-store.c	21 Oct 2005 05:26:46 -0000	1.334
+++ camel-imap-store.c	10 Nov 2005 10:09:49 -0000
@@ -1281,6 +1281,7 @@
 	char *errbuf = NULL;
 	gboolean authenticated = FALSE;
 	const char *auth_domain;
+	const char *err_desc; 
 	
 	CAMEL_SERVICE_ASSERT_LOCKED (store, connect_lock);
 	auth_domain = camel_url_get_param (service->url, "auth-domain");
@@ -1370,10 +1371,11 @@
 		if (!authenticated) {
 			if (camel_exception_get_id(ex) == CAMEL_EXCEPTION_USER_CANCEL)
 				return FALSE;
-			
+
+			err_desc = camel_exception_get_description (ex);
 			errbuf = g_strdup_printf (_("Unable to authenticate "
 						    "to IMAP server.\n%s\n\n"),
-						  camel_exception_get_description (ex));
+						  err_desc ? err_desc : "");
 			camel_exception_clear (ex);
 		}
 	}


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