x11/keymap: be more defensive about the number of modifiers
authorRan Benita <ran234@gmail.com>
Fri, 8 Aug 2014 14:21:28 +0000 (17:21 +0300)
committerRan Benita <ran234@gmail.com>
Fri, 8 Aug 2014 14:29:42 +0000 (17:29 +0300)
commitf00e779ab5064ee2bd4bc2ffec75996a8f64e98d
tree34108cc2c3765e11d442461b3055781e7db01b46
parent01753c0475d8f210ce69e9a58c2b01203c03d112
x11/keymap: be more defensive about the number of modifiers

There can be at most 16 vmods, and we rely on the facts that #vmods +
NUM_REAL_MODS (8) <= XKB_MAX_MODS (32) when accessing keymap->mods.mods.
But msb_pos() can potentially return up to #vmods = 32 if the server is
malicious, so we need to truncate it.

Signed-off-by: Ran Benita <ran234@gmail.com>
src/x11/keymap.c