Subject: xg_win_to_widget uninitialized access
From: Dan Nicolaescu <[email-masked]>
To: [email-masked]
Date: Fri, 28 Oct 2011 21:59:02 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

valgrind gives a warning for an uninitialized access in
xg_win_to_widget for the gtk_get_event_widget call.

 if (gdkwin)
    {
      GdkEvent event;
      event.any.window = gdkwin;
      gwdesc = gtk_get_event_widget (&event);
    }

gtk_get_event_widget is (in gtk3):

GtkWidget*
gtk_get_event_widget (GdkEvent *event)
{
  GtkWidget *widget;
  gpointer widget_ptr;

  widget = NULL;
  if (event && event->any.window &&
      (event->type == GDK_DESTROY || !gdk_window_is_destroyed
  (event->any.window)))
    {
      gdk_window_get_user_data (event->any.window, &widget_ptr);
      widget = widget_ptr;
    }

  return widget;
}

so indeed event->type is uninitialized.