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 <ext-pauli.nieminen@nokia.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Pauli Nieminen 2010-07-26 15:13:34 +03:00 committed by Peter Hutterer
parent d6642de7eb
commit 2e6d717404

View File

@ -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))