GNU bug report logs - #9901
xg_win_to_widget uninitialized access

Previous Next

Package: emacs;

Reported by: Dan Nicolaescu <dann <at> gnu.org>

Date: Sat, 29 Oct 2011 02:02:01 UTC

Severity: normal

Done: Jan Djärv <jan.h.d <at> swipnet.se>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Dan Nicolaescu <dann <at> gnu.org>
Subject: bug#9901: closed (Re: bug#9901: xg_win_to_widget uninitialized
 access)
Date: Sun, 30 Oct 2011 17:35:01 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#9901: xg_win_to_widget uninitialized access

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 9901 <at> debbugs.gnu.org.

-- 
9901: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9901
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Jan Djärv <jan.h.d <at> swipnet.se>
To: Dan Nicolaescu <dann <at> gnu.org>
Cc: 9901-done <at> debbugs.gnu.org
Subject: Re: bug#9901: xg_win_to_widget uninitialized access
Date: Sun, 30 Oct 2011 18:32:16 +0100
Fixed.

	Jan D.

29 okt 2011 kl. 03:59 skrev Dan Nicolaescu:

> 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.
> 
> 
> 


[Message part 3 (message/rfc822, inline)]
From: Dan Nicolaescu <dann <at> gnu.org>
To: bug-gnu-emacs <at> gnu.org
Subject: xg_win_to_widget uninitialized access
Date: Fri, 28 Oct 2011 21:59:02 -0400
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.




This bug report was last modified 13 years and 227 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.