Re: [evolution-patches] mail, 311440, crash viewing mail (Adding fix for #274544)



while this is here, a similar fix in bbdb plugin, which would fix,
http://bugzilla.gnome.org/show_bug.cgi?id=274544

And other scenarios where CamelAddress can be NULL, and we end up using
it.

Attached is the patch.
Thanks,
Vivek Jain

On Thu, 2005-07-28 at 10:23 +0800, Not Zed wrote:
> 
> _______________________________________________
> evolution-patches mailing list
> evolution-patches lists ximian com
> http://lists.ximian.com/mailman/listinfo/evolution-patches
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/plugins/bbdb/ChangeLog,v
retrieving revision 1.16
diff -u -p -r1.16 ChangeLog
--- ChangeLog	12 May 2005 04:27:36 -0000	1.16
+++ ChangeLog	28 Jul 2005 04:21:52 -0000
@@ -1,3 +1,9 @@
+2005-07-28  Vivek Jain  <jvivek novell com>
+	
+	* bbdb.c:(bbdb_handle_reply):check for NULL
+	before using the address.
+	**Fixes bugs like #274544
+
 2005-05-11  Not Zed  <NotZed Ximian com>
 
 	* Makefile.am: setup cleanfiles/built_sources
Index: bbdb.c
===================================================================
RCS file: /cvs/gnome/evolution/plugins/bbdb/bbdb.c,v
retrieving revision 1.8
diff -u -p -r1.8 bbdb.c
--- bbdb.c	11 Apr 2005 06:35:07 -0000	1.8
+++ bbdb.c	28 Jul 2005 04:21:53 -0000
@@ -115,11 +115,13 @@ bbdb_handle_reply (EPlugin *ep, EMEventT
 		return;
 
 	cia = camel_mime_message_get_from (target->message);
-	for (i = 0; i < camel_address_length (CAMEL_ADDRESS (cia)); i ++) {
-		const char *name=NULL, *email=NULL;
-		if (!(camel_internet_address_get (cia, i, &name, &email)))
-			continue;
-		bbdb_do_it (book, name, email);
+	if (cia) {
+		for (i = 0; i < camel_address_length (CAMEL_ADDRESS (cia)); i ++) {
+			const char *name=NULL, *email=NULL;
+			if (!(camel_internet_address_get (cia, i, &name, &email)))
+				continue;
+			bbdb_do_it (book, name, email);
+		}
 	}
 
 	/* If this is a reply-all event, process To: and Cc: also. */
@@ -129,19 +131,23 @@ bbdb_handle_reply (EPlugin *ep, EMEventT
 	}
 
 	cia = camel_mime_message_get_recipients (target->message, CAMEL_RECIPIENT_TYPE_TO);
-	for (i = 0; i < camel_address_length (CAMEL_ADDRESS (cia)); i ++) {
-		const char *name=NULL, *email=NULL;
-		if (!(camel_internet_address_get (cia, i, &name, &email)))
-			continue;
-		bbdb_do_it (book, name, email);
+	if (cia) {
+		for (i = 0; i < camel_address_length (CAMEL_ADDRESS (cia)); i ++) {
+			const char *name=NULL, *email=NULL;
+			if (!(camel_internet_address_get (cia, i, &name, &email)))
+				continue;
+			bbdb_do_it (book, name, email);
+		}
 	}
 
 	cia = camel_mime_message_get_recipients (target->message, CAMEL_RECIPIENT_TYPE_CC);
-	for (i = 0; i < camel_address_length (CAMEL_ADDRESS (cia)); i ++) {
-		const char *name=NULL, *email=NULL;
-		if (!(camel_internet_address_get (cia, i, &name, &email)))
-			continue;
-		bbdb_do_it (book, name, email);
+	if (cia) {
+		for (i = 0; i < camel_address_length (CAMEL_ADDRESS (cia)); i ++) {
+			const char *name=NULL, *email=NULL;
+			if (!(camel_internet_address_get (cia, i, &name, &email)))
+				continue;
+			bbdb_do_it (book, name, email);
+		}
 	}
 
 	g_object_unref (G_OBJECT (book));


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