GNOME Bugzilla – Bug 595183
Multiple NULL dereferences to get_monitor() in gdk/x11/gdkscreen-x11.c
Last modified: 2009-09-18 21:25:30 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.
the g_return_if_fail() in get_monitor is a way to say "you are not allowed to pass an invalid monitor"
See bug 561130.
*** This bug has been marked as a duplicate of bug 561130 ***