xkb: check for NULL pointer before dereferences it in XkbWriteXKBSymbols
move srv assignment to before it's being used. Also, check for xkb being nil. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
471f350c99
commit
b36eeb713a
|
@ -353,9 +353,13 @@ XkbClientMapPtr map;
|
||||||
XkbServerMapPtr srv;
|
XkbServerMapPtr srv;
|
||||||
Bool showActions;
|
Bool showActions;
|
||||||
|
|
||||||
|
if (!xkb) {
|
||||||
|
_XkbLibError(_XkbErrMissingSymbols,"XkbWriteXKBSymbols",0);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
map= xkb->map;
|
map= xkb->map;
|
||||||
srv= xkb->server;
|
if ((!map)||(!map->syms)||(!map->key_sym_map)) {
|
||||||
if ((!xkb)||(!map)||(!map->syms)||(!map->key_sym_map)) {
|
|
||||||
_XkbLibError(_XkbErrMissingSymbols,"XkbWriteXKBSymbols",0);
|
_XkbLibError(_XkbErrMissingSymbols,"XkbWriteXKBSymbols",0);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -376,6 +380,7 @@ Bool showActions;
|
||||||
}
|
}
|
||||||
if (tmp>0)
|
if (tmp>0)
|
||||||
fprintf(file,"\n");
|
fprintf(file,"\n");
|
||||||
|
srv= xkb->server;
|
||||||
for (i=xkb->min_key_code;i<=xkb->max_key_code;i++) {
|
for (i=xkb->min_key_code;i<=xkb->max_key_code;i++) {
|
||||||
Bool simple;
|
Bool simple;
|
||||||
if ((int)XkbKeyNumSyms(xkb,i)<1)
|
if ((int)XkbKeyNumSyms(xkb,i)<1)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user