After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 595183 - Multiple NULL dereferences to get_monitor() in gdk/x11/gdkscreen-x11.c
Multiple NULL dereferences to get_monitor() in gdk/x11/gdkscreen-x11.c
Status: RESOLVED DUPLICATE of bug 561130
Product: gtk+
Classification: Platform
Component: Backend: X11
2.16.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2009-09-14 15:00 UTC by longpoke
Modified: 2009-09-18 21:25 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description longpoke 2009-09-14 15:00:20 UTC
Code such as this will break if an invalid monitor is passed:

gint
gdk_screen_get_monitor_width_mm	(GdkScreen *screen,
				 gint       monitor_num)
{
  return get_monitor (screen, monitor_num)->width_mm;
}

get_monitor() will return NULL if passed an invalid monitor_num and a segfault will occur.

The following functions in  gdk/x11/gdkscreen-x11.c are effected:
gdk_screen_get_monitor_width_mm()
gdk_screen_get_monitor_height_mm()
gdk_screen_get_monitor_plug_name()
gdk_x11_screen_get_monitor_output()
gdk_screen_get_monitor_geometry()

Is this user not allowed to pass an invalid monitor_num to these functions? If so, this is a pygtk bug.

I originally reported here: http://bugs.gentoo.org/show_bug.cgi?id=284852, the bug is in my older version (2.14.7) too.
Comment 1 Matthias Clasen 2009-09-14 15:17:15 UTC
the g_return_if_fail() in get_monitor is a way to say "you are not allowed to pass an invalid monitor"
Comment 2 Christian Dywan 2009-09-14 17:50:46 UTC
See bug 561130.
Comment 3 Matthias Clasen 2009-09-18 21:25:30 UTC

*** This bug has been marked as a duplicate of bug 561130 ***