aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-contact-list-view.c
diff options
context:
space:
mode:
authorPhilip Withnall <philip@tecnocode.co.uk>2011-03-30 22:18:03 +0800
committerPhilip Withnall <philip@tecnocode.co.uk>2011-04-05 08:59:48 +0800
commitd7f6a39d2d12d9c66b94dfd58488b9c8f9aea35e (patch)
treee5f0ffef7fec73895cc41b57b3e47dccb43adab4 /libempathy-gtk/empathy-contact-list-view.c
parentcf5ae6bf0560a62e108eb43b172e1ee837d0aa9c (diff)
downloadgsoc2013-empathy-d7f6a39d2d12d9c66b94dfd58488b9c8f9aea35e.tar
gsoc2013-empathy-d7f6a39d2d12d9c66b94dfd58488b9c8f9aea35e.tar.gz
gsoc2013-empathy-d7f6a39d2d12d9c66b94dfd58488b9c8f9aea35e.tar.bz2
gsoc2013-empathy-d7f6a39d2d12d9c66b94dfd58488b9c8f9aea35e.tar.lz
gsoc2013-empathy-d7f6a39d2d12d9c66b94dfd58488b9c8f9aea35e.tar.xz
gsoc2013-empathy-d7f6a39d2d12d9c66b94dfd58488b9c8f9aea35e.tar.zst
gsoc2013-empathy-d7f6a39d2d12d9c66b94dfd58488b9c8f9aea35e.zip
Bug 646227 — Possible overflow in persona-view:drag_data_get
I think it was a fluke that this code worked in the first place, since it was accessing arrays with indices which were out of range, and which wouldn't have corresponded to the correct entries even if they were in range. This should fix the mapping between DND types and DND URIs/atoms in the contact list, individual and persona views. Closes: bgo#646227
Diffstat (limited to 'libempathy-gtk/empathy-contact-list-view.c')
-rw-r--r--libempathy-gtk/empathy-contact-list-view.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/libempathy-gtk/empathy-contact-list-view.c b/libempathy-gtk/empathy-contact-list-view.c
index 0b7cabd91..dace4f909 100644
--- a/libempathy-gtk/empathy-contact-list-view.c
+++ b/libempathy-gtk/empathy-contact-list-view.c
@@ -112,9 +112,6 @@ static const GtkTargetEntry drag_types_source[] = {
{ "text/contact-id", 0, DND_DRAG_TYPE_CONTACT_ID },
};
-static GdkAtom drag_atoms_dest[G_N_ELEMENTS (drag_types_dest)];
-static GdkAtom drag_atoms_source[G_N_ELEMENTS (drag_types_source)];
-
enum {
DRAG_CONTACT_RECEIVED,
LAST_SIGNAL
@@ -761,7 +758,8 @@ contact_list_view_drag_data_get (GtkWidget *widget,
str = g_strconcat (account_id, ":", contact_id, NULL);
if (info == DND_DRAG_TYPE_CONTACT_ID) {
- gtk_selection_data_set (selection, drag_atoms_source[info], 8,
+ gtk_selection_data_set (selection,
+ gdk_atom_intern ("text/contact-id", FALSE), 8,
(guchar *) str, strlen (str) + 1);
}
@@ -1506,7 +1504,6 @@ contact_list_view_constructed (GObject *object)
EmpathyContactListViewPriv *priv = GET_PRIV (view);
GtkCellRenderer *cell;
GtkTreeViewColumn *col;
- guint i;
priv->filter = GTK_TREE_MODEL_FILTER (gtk_tree_model_filter_new (
GTK_TREE_MODEL (priv->store), NULL));
@@ -1638,17 +1635,6 @@ contact_list_view_constructed (GObject *object)
/* Actually add the column now we have added all cell renderers */
gtk_tree_view_append_column (GTK_TREE_VIEW (view), col);
-
- /* Drag & Drop. */
- for (i = 0; i < G_N_ELEMENTS (drag_types_dest); ++i) {
- drag_atoms_dest[i] = gdk_atom_intern (drag_types_dest[i].target,
- FALSE);
- }
-
- for (i = 0; i < G_N_ELEMENTS (drag_types_source); ++i) {
- drag_atoms_source[i] = gdk_atom_intern (drag_types_source[i].target,
- FALSE);
- }
}
static void