mirror of
https://github.com/X11Libre/xserver.git
synced 2026-09-29 21:46:40 +00:00
Fix two glaring unconditional-NULL-dereferences.
This commit is contained in:
parent
a68c11bb1d
commit
aae4238360
2 changed files with 12 additions and 0 deletions
|
|
@ -682,6 +682,9 @@ CARD16 grp_mask;
|
|||
XkbStatePtr state= &xkbi->state;
|
||||
XkbCompatMapPtr map;
|
||||
|
||||
if (!state || !xkbi->desc || !xkbi->desc->ctrls || !xkbi->desc->compat)
|
||||
return;
|
||||
|
||||
map= xkbi->desc->compat;
|
||||
grp_mask= map->groups[state->group].mask;
|
||||
state->compat_state = state->mods|grp_mask;
|
||||
|
|
@ -741,6 +744,9 @@ XkbStatePtr state= &xkbi->state;
|
|||
XkbControlsPtr ctrls= xkbi->desc->ctrls;
|
||||
unsigned char grp;
|
||||
|
||||
if (!state || !ctrls)
|
||||
return;
|
||||
|
||||
state->mods= (state->base_mods|state->latched_mods);
|
||||
state->mods|= state->locked_mods;
|
||||
state->lookup_mods= state->mods&(~ctrls->internal.mask);
|
||||
|
|
|
|||
Loading…
Reference in a new issue