summaryrefslogtreecommitdiff
path: root/src/xkb/XKBNames.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xkb/XKBNames.c')
-rw-r--r--src/xkb/XKBNames.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/xkb/XKBNames.c b/src/xkb/XKBNames.c
index 0276c05b..0f1e48e5 100644
--- a/src/xkb/XKBNames.c
+++ b/src/xkb/XKBNames.c
@@ -180,6 +180,8 @@ _XkbReadGetNamesReply( Display * dpy,
nKeys= xkb->max_key_code+1;
names->keys= _XkbTypedCalloc(nKeys,XkbKeyNameRec);
}
+ else if ( ((int)rep->firstKey + rep->nKeys) > xkb->max_key_code)
+ goto BAILOUT;
if (names->keys!=NULL) {
if (!_XkbCopyFromReadBuffer(&buf,
(char *)&names->keys[rep->firstKey],