From: Peter Hutterer Date: Wed, 10 May 2017 19:22:00 +0000 (+1000) Subject: udev: don't allow pointing stick sensitivities greater than 255 (#5927) X-Git-Tag: v234~222 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=61b2f1976cec698696f6a2fe9b2f2c89e72571de;p=platform%2Fupstream%2Fsystemd.git 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 --- diff --git a/src/udev/udev-builtin-keyboard.c b/src/udev/udev-builtin-keyboard.c index 07a2f94..55f44da 100644 --- a/src/udev/udev-builtin-keyboard.c +++ b/src/udev/udev-builtin-keyboard.c @@ -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);