From 6dd4fc4652f942724039dc2317c560ea7276ab59 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Mon, 16 Oct 2006 00:22:00 +0300 Subject: [PATCH] xkb: fix virtual modmap size computation Compute virtual modmap size bounded by nVModMapKeys-1, rather than nVModMapKeys. This is sort of a best guess. The other way seems a little more logical, but also leads to segfaults pretty quickly if you hammer GetMap hard enough. So let's try this one. --- xkb/xkb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xkb/xkb.c b/xkb/xkb.c index ba8fc7fbc..bceaf49ff 100644 --- a/xkb/xkb.c +++ b/xkb/xkb.c @@ -1325,7 +1325,7 @@ unsigned short * pMap; wire= (xkbVModMapWireDesc *)buf; pMap= &xkb->server->vmodmap[rep->firstVModMapKey]; - for (i=0;inVModMapKeys;i++,pMap++) { + for (i=0;inVModMapKeys-1;i++,pMap++) { if (*pMap!=0) { wire->key= i+rep->firstVModMapKey; wire->vmods= *pMap;