Fix two glaring unconditional-NULL-dereferences.

This commit is contained in:
Daniel Stone 2006-03-25 20:17:58 +00:00
parent a68c11bb1d
commit aae4238360
2 changed files with 12 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2006-03-25 Daniel Stone <daniel@freedesktop.org>
* xkb/xkbUtils.c:
Fix two of the more glaring unconditional-NULL-dereference screwups.
There are many more left.
2006-03-25 Adam Jackson <ajax@freedesktop.org>
* hw/xfree86/common/xf86Bus.c:

View File

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