summaryrefslogtreecommitdiff
path: root/src/x11
diff options
context:
space:
mode:
authorRan Benita <ran234@gmail.com>2014-02-09 10:27:45 +0200
committerRan Benita <ran234@gmail.com>2014-02-09 14:05:59 +0200
commitd53eef0d9411a94cdb0f21e2cd6cb072ea387377 (patch)
treed34f96f4b611c7b039db2a730dd218c95e9df858 /src/x11
parent032f8b67f5c3fe8935c0ada496b6de7872663c2a (diff)
downloadxorg-lib-libxkbcommon-d53eef0d9411a94cdb0f21e2cd6cb072ea387377.tar.gz
x11: add 0 < ctrls->numGroups <= 4 assertion
This only happens if something is wrong in the server; a valid keymap cannot be had in any case. Signed-off-by: Ran Benita <ran234@gmail.com>
Diffstat (limited to 'src/x11')
-rw-r--r--src/x11/keymap.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/x11/keymap.c b/src/x11/keymap.c
index aa91033..4c6b29c 100644
--- a/src/x11/keymap.c
+++ b/src/x11/keymap.c
@@ -1099,6 +1099,7 @@ get_controls(struct xkb_keymap *keymap, xcb_connection_t *conn,
xcb_xkb_get_controls_reply(conn, cookie, NULL);
FAIL_IF_BAD_REPLY(reply, "XkbGetControls");
+ FAIL_UNLESS(reply->numGroups > 0 && reply->numGroups <= 4);
keymap->enabled_ctrls = translate_controls_mask(reply->enabledControls);
keymap->num_groups = reply->numGroups;