[evolution-patches] smime cert set crash




The guy said he was filing a bug but i haven't seen it anywhere, anyway, bit of bt relevent:

#3  <signal handler called>
#4  0x4871b9e8 in strcmp () from /lib/tls/libc.so.6
#5  0x40f00914 in e_cert_selector_new (type=0, currentid=0x87ee328 "")
    at e-cert-selector.c:194
#6  0x40ebcf75 in smime_sign_key_select (button=0x87dbe30, gui=0x879dcb8)
    at mail-account-gui.c:1717

I guess emailAddr or nickname can be NULL, this patch protects against that case.

Sigh, why doesn't the file selector select the file when you double-click an entry.

--
Michael Zucchi <notzed ximian com>
"born to die, live to work, it's all downhill from here"
Novell's Evolution and Free Software Developer
Index: smime/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/smime/ChangeLog,v
retrieving revision 1.41.2.1
diff -u -3 -r1.41.2.1 ChangeLog
--- smime/ChangeLog	4 Sep 2004 02:53:57 -0000	1.41.2.1
+++ smime/ChangeLog	11 Oct 2004 08:40:01 -0000
@@ -1,3 +1,8 @@
+2004-10-11  Not Zed  <NotZed Ximian com>
+
+	* gui/e-cert-selector.c (e_cert_selector_new): dont try to
+	deference NULL nickname or emailAddr on the cert.
+
 2004-09-03  Not Zed  <NotZed Ximian com>
 
 	** See bug #64420.
Index: smime/gui/e-cert-selector.c
===================================================================
RCS file: /cvs/gnome/evolution/smime/gui/e-cert-selector.c,v
retrieving revision 1.6
diff -u -3 -r1.6 e-cert-selector.c
--- smime/gui/e-cert-selector.c	21 May 2004 02:37:04 -0000	1.6
+++ smime/gui/e-cert-selector.c	11 Oct 2004 08:40:01 -0000
@@ -185,16 +185,19 @@
 	if (certlist != NULL) {
 		node = CERT_LIST_HEAD(certlist);
 		while (!CERT_LIST_END(node, certlist)) {
-			w = gtk_menu_item_new_with_label(node->cert->nickname);
-			gtk_menu_shell_append((GtkMenuShell *)menu, w);
-			gtk_widget_show(w);
+			if (node->cert->nickname || node->cert->emailAddr) {
+				w = gtk_menu_item_new_with_label(node->cert->nickname?node->cert->nickname:node->cert->emailAddr);
+				gtk_menu_shell_append((GtkMenuShell *)menu, w);
+				gtk_widget_show(w);
 
-			if (currentid != NULL
-			    && (strcmp(node->cert->nickname, currentid) == 0
-				|| strcmp(node->cert->emailAddr, currentid) == 0))
-				active = n;
+				if (currentid != NULL
+				    && ((node->cert->nickname != NULL && strcmp(node->cert->nickname, currentid) == 0)
+					|| (node->cert->emailAddr != NULL && strcmp(node->cert->emailAddr, currentid) == 0)))
+					active = n;
+				
+				n++;
+			}
 
-			n++;
 			node = CERT_LIST_NEXT(node);
 		}
 	}


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