diff options
author | Vojtech Pavlik <vojtech@suse.cz> | 2005-07-24 01:50:03 -0400 |
---|---|---|
committer | Dmitry Torokhov <dtor_core@ameritech.net> | 2005-07-24 01:50:03 -0400 |
commit | 5ac7ba3ff599d66ffde182676f2e4fbcac61a2fe (patch) | |
tree | 5c8e25dc2797cb0e063c38afda2dbbf292e34bd3 /drivers/input | |
parent | 463a4f76a79bce00ca8964e0b2ebf7f10f376965 (diff) |
Input: check keycodesize when adjusting keymaps
When changing key mappings we need to make sure that the new
keycode value can be stored in dev->keycodesize bytes.
Signed-off-by: Vojtech Pavlik <vojtech@suse.cz>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/evdev.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index 374f404e81da..20e3a165989f 100644 --- a/drivers/input/evdev.c +++ b/drivers/input/evdev.c | |||
@@ -320,6 +320,7 @@ static long evdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
320 | if (t < 0 || t >= dev->keycodemax || !dev->keycodesize) return -EINVAL; | 320 | if (t < 0 || t >= dev->keycodemax || !dev->keycodesize) return -EINVAL; |
321 | if (get_user(v, ip + 1)) return -EFAULT; | 321 | if (get_user(v, ip + 1)) return -EFAULT; |
322 | if (v < 0 || v > KEY_MAX) return -EINVAL; | 322 | if (v < 0 || v > KEY_MAX) return -EINVAL; |
323 | if (v >> (dev->keycodesize * 8)) return -EINVAL; | ||
323 | u = SET_INPUT_KEYCODE(dev, t, v); | 324 | u = SET_INPUT_KEYCODE(dev, t, v); |
324 | clear_bit(u, dev->keybit); | 325 | clear_bit(u, dev->keybit); |
325 | set_bit(v, dev->keybit); | 326 | set_bit(v, dev->keybit); |