[gpointing-device-settings] don't crash, when having no device #722770

tomspur tomspur at fedoraproject.org
Tue Jul 19 23:19:54 UTC 2011


commit 03d7a16deb252b54197eb5275ed8a1f7f9a60e30
Author: Thomas Spura <thomas.spura at gmail.com>
Date:   Wed Jul 20 01:19:21 2011 +0200

    don't crash, when having no device #722770

 gpds-1.5.1-strcmp-no-device.patch |   21 +++++++++++++++++++++
 gpointing-device-settings.spec    |   10 +++++++++-
 2 files changed, 30 insertions(+), 1 deletions(-)
---
diff --git a/gpds-1.5.1-strcmp-no-device.patch b/gpds-1.5.1-strcmp-no-device.patch
new file mode 100644
index 0000000..6c4e9c9
--- /dev/null
+++ b/gpds-1.5.1-strcmp-no-device.patch
@@ -0,0 +1,21 @@
+Index: src/gpds-xinput-utils.c
+===================================================================
+--- src/gpds-xinput-utils.c
++++ src/gpds-xinput-utils.c	2011-07-19 19:09:28.409024460 +0200
+@@ -38,6 +38,8 @@
+ XDeviceInfo *
+ gpds_xinput_utils_get_device_info (const gchar *device_name, GError **error)
+ {
++    if (!device_name)
++        goto out_gpds_xinput_utils_get_device_info;
+     XDeviceInfo *device_infos;
+     gint i, n_device_infos;
+ 
+@@ -54,6 +56,7 @@
+ 
+     XFreeDeviceList(device_infos);
+ 
++out_gpds_xinput_utils_get_device_info:
+     g_set_error(error,
+                 GPDS_XINPUT_UTILS_ERROR,
+                 GPDS_XINPUT_UTILS_ERROR_NO_DEVICE,
diff --git a/gpointing-device-settings.spec b/gpointing-device-settings.spec
index d7f0a1c..bd4c9cc 100644
--- a/gpointing-device-settings.spec
+++ b/gpointing-device-settings.spec
@@ -1,6 +1,6 @@
 Name:           gpointing-device-settings
 Version:        1.5.1
-Release:        3%{?dist}
+Release:        4%{?dist}
 Summary:        Configuration tool for pointing devices
 
 Group:          Applications/System
@@ -36,6 +36,10 @@ Patch1:         gpds-1.5.1-fix_build_with_gtk22.patch
 # https://bugzilla.gnome.org/show_bug.cgi?id=637351
 Patch2:         gpsd-1.5.1-fix-build_with_newer_gsd.patch
 
+# Possible fix for https://bugzilla.redhat.com/show_bug.cgi?id=722770
+# don't crash, when having no device
+Patch3:         gpds-1.5.1-strcmp-no-device.patch
+
 %description
 GUI tool for setting pointing device such as TrackPoint or Touchpad. It
 allows configuring of various drivers parameters on the fly.
@@ -58,6 +62,7 @@ Development headers and libraries for %{name}.
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
+%patch3 -p0
 
 %build
 %configure \
@@ -142,6 +147,9 @@ fi
 
 
 %changelog
+* Tue Jul 19 2011 Thomas Spura <tomspur at fedoraproject.org> - 1.5.1-4
+- don't crash, when having no device #722770
+
 * Fri Dec 10 2010 Gianluca Sforna <giallu at gmail.com> - 1.5.1-3
 - Fix build against GTK+ 2.22
 - Fix build against newer gnome-settings-daemon


More information about the scm-commits mailing list