From e26f79335bb7a9ad34fe9b23c283a214202f89ed Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 17 Mar 2009 16:22:00 +1000 Subject: [PATCH] xkb: put a few extra checks in against non-keyboards --- xkb/xkb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xkb/xkb.c b/xkb/xkb.c index ba1a4f6fd..e7c9a312d 100644 --- a/xkb/xkb.c +++ b/xkb/xkb.c @@ -605,7 +605,7 @@ ProcXkbLatchLockState(ClientPtr client) for (tmpd = inputInfo.devices; tmpd; tmpd = tmpd->next) { if ((tmpd == dev) || (!tmpd->isMaster && tmpd->u.master == dev)) { - if (!tmpd->key->xkbInfo) + if (!tmpd->key || !tmpd->key->xkbInfo) continue; oldState = tmpd->key->xkbInfo->state; @@ -744,6 +744,8 @@ ProcXkbSetControls(ClientPtr client) CHK_MASK_LEGAL(0x01, stuff->changeCtrls, XkbAllControlsMask); for (tmpd = inputInfo.devices; tmpd; tmpd = tmpd->next) { + if (!tmpd->key || !tmpd->key->xkbInfo) + continue; if ((tmpd == dev) || (!tmpd->isMaster && tmpd->u.master == dev)) { xkbi = tmpd->key->xkbInfo; ctrl = xkbi->desc->ctrls;