[gnome-settings-daemon/gnome-3-2] wacom: Fix possible crasher



commit f65d29ce443ff72f7be1a9bd58c642da27fd0bd3
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Oct 7 13:08:57 2011 +0100

    wacom: Fix possible crasher
    
    If XListInputDevices() fails, the number of devices could
    be positive, and cause a crash.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=661170

 plugins/wacom/gsd-wacom-manager.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/plugins/wacom/gsd-wacom-manager.c b/plugins/wacom/gsd-wacom-manager.c
index 2965e97..a51a505 100644
--- a/plugins/wacom/gsd-wacom-manager.c
+++ b/plugins/wacom/gsd-wacom-manager.c
@@ -237,6 +237,8 @@ wacom_set_property (WacomType wacom_type,
         gint i;
 
         device_info = XListInputDevices (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), &n_devices);
+        if (device_info == NULL)
+                return;
 
         for (i = 0; i < n_devices; i++) {
                 XDevice *device = NULL;



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