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