[gtk+/gtk-3-22] widget: Typecheck before deref in translate_coords



commit 81d1aaa06283a2fcfba50966f2ab61db15424793
Author: Andrea Azzarone <andrea azzarone canonical com>
Date:   Thu Oct 19 08:36:50 2017 +0000

    widget: Typecheck before deref in translate_coords
    
    https://bugzilla.gnome.org/show_bug.cgi?id=771279

 gtk/gtkwidget.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 44112e5..6c2e74b 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -6281,8 +6281,8 @@ gtk_widget_translate_coordinates (GtkWidget  *src_widget,
                                  gint       *dest_x,
                                  gint       *dest_y)
 {
-  GtkWidgetPrivate *src_priv = src_widget->priv;
-  GtkWidgetPrivate *dest_priv = dest_widget->priv;
+  GtkWidgetPrivate *src_priv;
+  GtkWidgetPrivate *dest_priv;
   GtkWidget *ancestor;
   GdkWindow *window;
   GList *dest_list = NULL;
@@ -6294,6 +6294,9 @@ gtk_widget_translate_coordinates (GtkWidget  *src_widget,
   if (!ancestor || !_gtk_widget_get_realized (src_widget) || !_gtk_widget_get_realized (dest_widget))
     return FALSE;
 
+  src_priv = src_widget->priv;
+  dest_priv = dest_widget->priv;
+
   /* Translate from allocation relative to window relative */
   if (_gtk_widget_get_has_window (src_widget) && src_priv->parent)
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]