aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2003-12-10 10:25:31 +0800
committerMichael Zucci <zucchi@src.gnome.org>2003-12-10 10:25:31 +0800
commitcd6b8c0139d7bf38ffd48c887031cf8a3aa1c0d5 (patch)
treeadfd231315525df1cd79ef4fdd0fd540c1661873
parent1647f967b488c4109b05e83af421901c1ac2821d (diff)
downloadgsoc2013-evolution-cd6b8c0139d7bf38ffd48c887031cf8a3aa1c0d5.tar.gz
gsoc2013-evolution-cd6b8c0139d7bf38ffd48c887031cf8a3aa1c0d5.tar.zst
gsoc2013-evolution-cd6b8c0139d7bf38ffd48c887031cf8a3aa1c0d5.zip
if we get no matching certs, show empty menu rather than crashing. #51922.
2003-12-10 Not Zed <NotZed@Ximian.com> * gui/e-cert-selector.c (e_cert_selector_new): if we get no matching certs, show empty menu rather than crashing. #51922. svn path=/trunk/; revision=23898
-rw-r--r--smime/ChangeLog5
-rw-r--r--smime/gui/e-cert-selector.c28
2 files changed, 20 insertions, 13 deletions
diff --git a/smime/ChangeLog b/smime/ChangeLog
index a389558c4a..57a290a4ce 100644
--- a/smime/ChangeLog
+++ b/smime/ChangeLog
@@ -1,3 +1,8 @@
+2003-12-10 Not Zed <NotZed@Ximian.com>
+
+ * gui/e-cert-selector.c (e_cert_selector_new): if we get no
+ matching certs, show empty menu rather than crashing. #51922.
+
2003-12-05 JP Rosevear <jpr@ximian.com>
* lib/e-cert.c: fix for C89
diff --git a/smime/gui/e-cert-selector.c b/smime/gui/e-cert-selector.c
index b3fcabdc43..9c64ebb37e 100644
--- a/smime/gui/e-cert-selector.c
+++ b/smime/gui/e-cert-selector.c
@@ -176,19 +176,21 @@ e_cert_selector_new(int type, const char *currentid)
certlist = CERT_FindUserCertsByUsage(CERT_GetDefaultCertDB(), usage, FALSE, TRUE, NULL);
ecs->priv->certlist = certlist;
- 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 (currentid != NULL
- && (strcmp(node->cert->nickname, currentid) == 0
- || strcmp(node->cert->emailAddr, currentid) == 0))
- active = n;
-
- n++;
- node = CERT_LIST_NEXT(node);
+ 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 (currentid != NULL
+ && (strcmp(node->cert->nickname, currentid) == 0
+ || strcmp(node->cert->emailAddr, currentid) == 0))
+ active = n;
+
+ n++;
+ node = CERT_LIST_NEXT(node);
+ }
}
gtk_option_menu_set_menu((GtkOptionMenu *)p->menu, menu);