libinput/src
Olivier Fourdan f420c54a99 Fix an abort if the device speed is NaN
When using libinput with xf86-input-libinput, the device speed is
represented as a float passed via X properties.

If a buggy client gives a broken value, the conversions that occur
can cause the value of speed to be NaN (not a number), aka infinity.

In C, any comparison with NaN always gives false, whatever the value.

So that test in libinput_device_config_accel_set_speed():

   (speed < 1.0 || speed > 1.0)

will necessarily return FALSE, defeating the test of range.

However, since since any comparison with NaN is false, the
opposite assert() in accelerator_set_speed():

   (speed >= 1.0 && speed <= 1.0)

will be false as well, thus triggering the abort() and the crash of
the entire X server along with it.

The solution is to use the same construct in both routines, so that
it fails gracefully in libinput_device_config_accel_set_speed().

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-02-06 10:26:04 +10:00
..
evdev-mt-touchpad-buttons.c touchpad: mark two switch fallthroughs with comments 2015-02-04 09:11:46 +10:00
evdev-mt-touchpad-edge-scroll.c touchpad: add a TOUCH_HOVERING state 2015-01-16 07:42:47 +10:00
evdev-mt-touchpad-tap.c touchpad: fix a clang compiler warning 2015-01-06 09:53:30 +10:00
evdev-mt-touchpad.c test: add per-device udev rule support 2015-02-03 10:34:26 +10:00
evdev-mt-touchpad.h touchpad: hook up click method configuration 2015-01-16 10:34:24 +10:00
evdev.c Don't init pointer acceleration on absolute devices 2015-02-03 10:56:38 +10:00
evdev.h touchpad: re-route trackpoint buttons on the *50 Lenovo series 2015-01-29 14:43:57 +10:00
filter-private.h filter: add a configurable speed interface 2014-09-23 10:46:22 +10:00
filter.c filter: zalloc the struct to make sure the speed is initialized 2015-02-03 10:37:51 +10:00
filter.h Change default DPI to 1000 2014-12-02 10:16:31 +10:00
libinput-private.h Add a config interface for click methods 2015-01-16 09:56:49 +10:00
libinput-util.c Parse the MOUSE_WHEEL_CLICK_ANGLE udev property if present 2015-01-13 13:35:42 +10:00
libinput-util.h Change axis events to carry all directions 2015-01-13 13:54:21 +10:00
libinput-version.h.in Port evdev code to be used as a shared library 2013-11-12 22:37:20 +01:00
libinput.c Fix an abort if the device speed is NaN 2015-02-06 10:26:04 +10:00
libinput.h cosmetic: fix grammar in doxygen 2015-02-06 10:08:33 +10:00
libinput.pc.in Add -lrt to the libs 2014-07-03 09:59:43 +10:00
libinput.sym Remove libinput_event_pointer_get_axis from symbols 2015-01-22 11:57:13 +10:00
Makefile.am Declare libinput.sym as dependency 2014-12-23 13:27:13 +10:00
path.c path: make sure udev devices are initialized before usage 2015-02-04 08:14:50 +10:00
path.h path: store the udev device instead of just the devnode 2014-11-25 16:33:01 +10:00
timer.c Add a helper function for clock_gettime 2014-09-18 11:30:15 +10:00
timer.h timer.h: Add #include libinput-util.h 2014-06-11 10:30:12 +10:00
udev-seat.c udev: only apply default calibration on absolute devices 2014-12-05 14:04:18 +10:00
udev-seat.h udev: Drop unused seat_name in struct udev_seat 2014-01-16 20:42:30 +01:00