aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--addressbook/ChangeLog7
-rw-r--r--addressbook/gui/merging/eab-contact-compare.c15
2 files changed, 20 insertions, 2 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index eb3e556e49..09891b18a9 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,10 @@
+2004-09-29 Hans Petter Jansson <hpj@ximian.com>
+
+ Fixes bug #65537.
+
+ * gui/merging/eab-contact-compare.c (query_cb): Protect against NULL
+ UIDs, and make fewer calls to e_contact_get_const () as a bonus.
+
2004-09-24 Hao Sheng <hao.sheng@sun.com>
Fix for #66523
diff --git a/addressbook/gui/merging/eab-contact-compare.c b/addressbook/gui/merging/eab-contact-compare.c
index bc68784ed7..4244f3fbff 100644
--- a/addressbook/gui/merging/eab-contact-compare.c
+++ b/addressbook/gui/merging/eab-contact-compare.c
@@ -613,11 +613,22 @@ query_cb (EBook *book, EBookStatus status, GList *contacts, gpointer closure)
/* remove the contacts we're to avoid from the list, if they're present */
for (i = contacts; i != NULL; i = g_list_next (i)) {
EContact *this_contact = E_CONTACT (i->data);
+ const gchar *this_uid;
GList *iterator;
gboolean avoid = FALSE;
+
+ this_uid = e_contact_get_const (this_contact, E_CONTACT_UID);
+ if (!this_uid)
+ continue;
+
for (iterator = info->avoid; iterator; iterator = iterator->next) {
- if (!strcmp (e_contact_get_const (iterator->data, E_CONTACT_UID),
- e_contact_get_const (this_contact, E_CONTACT_UID))) {
+ const gchar *avoid_uid;
+
+ avoid_uid = e_contact_get_const (iterator->data, E_CONTACT_UID);
+ if (!avoid_uid)
+ continue;
+
+ if (!strcmp (avoid_uid, this_uid)) {
avoid = TRUE;
break;
}