From d7696bd25f2ab273334b4ddbc96561b956b8fd44 Mon Sep 17 00:00:00 2001 From: Tristan Van Berkom Date: Fri, 26 Aug 2011 18:58:44 +0200 Subject: [PATCH] Avoid dereferencing NULL pointer in gtk_label_drag_data_get() It's possible the GtkLabel receives drag'n'drop related signals if it was setup to receive them by a container or other external code, just avoid dereferencing priv->select_info in this case. --- gtk/gtklabel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c index 9fadbfd2d2..0bb962c1ac 100644 --- a/gtk/gtklabel.c +++ b/gtk/gtklabel.c @@ -5333,7 +5333,8 @@ gtk_label_set_selection_text (GtkLabel *label, { GtkLabelPrivate *priv = label->priv; - if ((priv->select_info->selection_anchor != + if (priv->select_info && + (priv->select_info->selection_anchor != priv->select_info->selection_end) && priv->text) {