diff options
Diffstat (limited to 'addressbook')
-rw-r--r-- | addressbook/ChangeLog | 6 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-addressbook-view.c | 17 |
2 files changed, 18 insertions, 5 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index b96143ff7b..ad9e713a44 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,9 @@ +2004-01-26 Radek Doulik <rodo@ximian.com> + + * gui/widgets/e-addressbook-view.c (selection_received): make sure + we pass \0 terminated string to eab_contact_list_from_string + [it may fix #51743] + 2004-01-25 Chris Toshok <toshok@ximian.com> [ fixes bug #51171 ] diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c index e3be750b07..633988ee31 100644 --- a/addressbook/gui/widgets/e-addressbook-view.c +++ b/addressbook/gui/widgets/e-addressbook-view.c @@ -1905,13 +1905,19 @@ selection_received (GtkWidget *invisible, guint time, EABView *view) { - if (selection_data->length < 0 || selection_data->type != GDK_SELECTION_TYPE_STRING) { + if (selection_data->length <= 0 || selection_data->type != GDK_SELECTION_TYPE_STRING) { return; - } - else { - /* XXX make sure selection_data->data = \0 terminated */ - GList *contact_list = eab_contact_list_from_string (selection_data->data); + } else { + GList *contact_list; GList *l; + char *str = NULL; + + if (selection_data->data [selection_data->length - 1] != 0) { + str = g_malloc0 (selection_data->length + 1); + memcpy (str, selection_data->data, selection_data->length); + contact_list = eab_contact_list_from_string (str); + } else + contact_list = eab_contact_list_from_string (selection_data->data); for (l = contact_list; l; l = l->next) { EContact *contact = l->data; @@ -1922,6 +1928,7 @@ selection_received (GtkWidget *invisible, g_list_foreach (contact_list, (GFunc)g_object_unref, NULL); g_list_free (contact_list); + g_free (str); } } |