xkb: Fix possible NULL pointer dereference
If search for device failed sli is NULL. In that case we have to protect dereference to prevent server crash. Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
adc0697cfc
commit
d6642de7eb
|
@ -714,10 +714,12 @@ XkbSrvLedInfoPtr sli;
|
|||
}
|
||||
}
|
||||
}
|
||||
if ((sli->names==NULL)&&(needed_parts&XkbXI_IndicatorNamesMask))
|
||||
sli->names= calloc(XkbNumIndicators, sizeof(Atom));
|
||||
if ((sli->maps==NULL)&&(needed_parts&XkbXI_IndicatorMapsMask))
|
||||
sli->maps= calloc(XkbNumIndicators, sizeof(XkbIndicatorMapRec));
|
||||
if (sli) {
|
||||
if ((sli->names==NULL)&&(needed_parts&XkbXI_IndicatorNamesMask))
|
||||
sli->names= calloc(XkbNumIndicators, sizeof(Atom));
|
||||
if ((sli->maps==NULL)&&(needed_parts&XkbXI_IndicatorMapsMask))
|
||||
sli->maps= calloc(XkbNumIndicators, sizeof(XkbIndicatorMapRec));
|
||||
}
|
||||
return sli;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user