From 2e6d7174042cc8007e947b7d9fb54acc0ebe29d2 Mon Sep 17 00:00:00 2001 From: Pauli Nieminen Date: Mon, 26 Jul 2010 15:13:34 +0300 Subject: [PATCH] xkb: Fix possible NULL pointer dereference sli is null before allocation assigment so deference t osli has to be protected. Signed-off-by: Pauli Nieminen Reviewed-by: Peter Hutterer --- xkb/xkbLEDs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xkb/xkbLEDs.c b/xkb/xkbLEDs.c index 16826713e..515e9b701 100644 --- a/xkb/xkbLEDs.c +++ b/xkb/xkbLEDs.c @@ -556,6 +556,7 @@ Bool checkNames; else if ((kf!=NULL)&&((kf->xkb_sli->flags&XkbSLI_IsDefault)!=0)) { XkbDescPtr xkb; xkb= dev->key->xkbInfo->desc; + sli= kf->xkb_sli; sli->physIndicators= xkb->indicators->phys_indicators; if (xkb->names->indicators!=sli->names) { checkNames= TRUE; @@ -584,6 +585,8 @@ Bool checkNames; sli->maps= NULL; sli->names= NULL; } + else + return NULL; if ((sli->names==NULL)&&(needed_parts&XkbXI_IndicatorNamesMask)) sli->names= calloc(XkbNumIndicators, sizeof(Atom)); if ((sli->maps==NULL)&&(needed_parts&XkbXI_IndicatorMapsMask))