From 3106ba1116e3b9d893f66a93e4a91cc61e23226a Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Sun, 13 Apr 2008 11:48:06 +0930 Subject: [PATCH] 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? --- xkb/xkbLEDs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xkb/xkbLEDs.c b/xkb/xkbLEDs.c index d7ada5749..1ea3e1116 100644 --- a/xkb/xkbLEDs.c +++ b/xkb/xkbLEDs.c @@ -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;