udev: don't allow pointing stick sensitivities greater than 255 (#5927)

It gets truncated, so the result is that people mess with the const accel
because the sensitivity isn't the expected 300 but the too-low 45.

One example: https://bugs.freedesktop.org/show_bug.cgi?id=100965
This commit is contained in:
Peter Hutterer 2017-05-11 05:22:00 +10:00 committed by Lennart Poettering
parent 554a080674
commit 61b2f1976c

View file

@ -173,6 +173,9 @@ static void set_trackpoint_sensitivity(struct udev_device *dev, const char *valu
if (r < 0) {
log_error("Unable to parse POINTINGSTICK_SENSITIVITY '%s' for '%s'", value, udev_device_get_devnode(dev));
return;
} else if (val_i < 0 || val_i > 255) {
log_error("POINTINGSTICK_SENSITIVITY %d outside range [0..255] for '%s' ", val_i, udev_device_get_devnode(dev));
return;
}
xsprintf(val_s, "%d", val_i);