mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-30 21:10:08 +01:00
read-only mirror of https://gitlab.freedesktop.org/libinput/libinput
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> |
||
|---|---|---|
| doc | ||
| include/linux | ||
| m4 | ||
| src | ||
| test | ||
| tools | ||
| .gitignore | ||
| autogen.sh | ||
| configure.ac | ||
| COPYING | ||
| Makefile.am | ||
| README.txt | ||
/*!@mainpage libinput ======== libinput is a library that handles input devices for display servers and other applications that need to directly deal with input devices. It provides device detection, device handling, input device event processing and abstraction so minimize the amount of custom input code the user of libinput need to provide the common set of functionality that users expect. Input event processing includes scaling touch coordinates, generating pointer events from touchpads, pointer acceleration, etc. libinput originates from weston, the Wayland reference compositor. The source code of libinput can be found at: http://cgit.freedesktop.org/wayland/libinput For more information, visit: http://www.freedesktop.org/wiki/Software/libinput/ Bugs can be filed in the libinput component of Wayland: https://bugs.freedesktop.org/enter_bug.cgi?product=Wayland Online API documentation: http://wayland.freedesktop.org/libinput/doc/latest/modules.html */