xkb: two fixes to avoid server crashes.

- map can be NULL in some cases, so don't try to dereference it.
- don't default to inputInfo.keyboard

This is firefighting, I presume something in the class copy may have gone
wrong to get a NULL map in the first instance?
This commit is contained in:
Peter Hutterer 2008-04-13 11:48:06 +09:30
parent 415c6df0da
commit 3106ba1116

View File

@ -447,7 +447,7 @@ XkbIndicatorMapPtr map;
XkbDescPtr xkb;
if ((sli->flags&XkbSLI_HasOwnState)==0)
dev= inputInfo.keyboard;
return;
sli->usesBase&= ~which;
sli->usesLatched&= ~which;
@ -462,7 +462,7 @@ XkbDescPtr xkb;
if (which&bit) {
CARD8 what;
if (!XkbIM_InUse(map))
if (!map || !XkbIM_InUse(map))
continue;
sli->mapsPresent|= bit;