summaryrefslogtreecommitdiff
path: root/xkb
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2006-03-25 20:17:58 +0000
committerDaniel Stone <daniel@fooishbar.org>2006-03-25 20:17:58 +0000
commitaae4238360b842ac34dc8ee16e165a1821f9a801 (patch)
tree7af383885bd8b24c06d9d7f8139ac17e6297f44f /xkb
parenta68c11bb1d7c5419004a1714e49dffac57304e78 (diff)
Fix two glaring unconditional-NULL-dereferences.
Diffstat (limited to 'xkb')
-rw-r--r--xkb/xkbUtils.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/xkb/xkbUtils.c b/xkb/xkbUtils.c
index f3c3ff8ca..70fb9e412 100644
--- a/xkb/xkbUtils.c
+++ b/xkb/xkbUtils.c
@@ -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);