summaryrefslogtreecommitdiff
path: root/xkb/xkbLEDs.c
diff options
context:
space:
mode:
authorPauli Nieminen <ext-pauli.nieminen@nokia.com>2010-07-26 15:13:34 +0300
committerPeter Hutterer <peter.hutterer@who-t.net>2010-09-01 14:43:03 +1000
commit2e6d7174042cc8007e947b7d9fb54acc0ebe29d2 (patch)
tree99c955e68e0f5d62defbd7d18216916d35ac12f0 /xkb/xkbLEDs.c
parentd6642de7ebdda16e0056600a86a7802bd4c393b7 (diff)
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>
Diffstat (limited to 'xkb/xkbLEDs.c')
-rw-r--r--xkb/xkbLEDs.c3
1 files changed, 3 insertions, 0 deletions
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))