]> Pileus Git - ~andy/gtk/commitdiff
Avoid dereferencing NULL pointer in gtk_label_drag_data_get()
authorTristan Van Berkom <tristan.van.berkom@gmail.com>
Fri, 26 Aug 2011 16:58:44 +0000 (18:58 +0200)
committerTristan Van Berkom <tristan.van.berkom@gmail.com>
Fri, 26 Aug 2011 17:02:36 +0000 (19:02 +0200)
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

index 9fadbfd2d2825bd8dba6226b497af42f0b353ca9..0bb962c1ac68151728251182cd2da8bcf59afe9d 100644 (file)
@@ -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)
     {