diff options
author | Tiago Vignatti <tiago.vignatti@nokia.com> | 2010-04-20 16:26:02 +0300 |
---|---|---|
committer | Tiago Vignatti <tiago.vignatti@nokia.com> | 2010-04-21 18:07:25 +0300 |
commit | b36eeb713a349961a6be8a6dd183ded6d27f9974 (patch) | |
tree | bf4724b3707278b5ed2314440cd52c66f8abd92e /xkb/xkbout.c | |
parent | 471f350c99b2e7c5a9045eef5ebff65cd2ddb7c5 (diff) |
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>
Diffstat (limited to 'xkb/xkbout.c')
-rw-r--r-- | xkb/xkbout.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/xkb/xkbout.c b/xkb/xkbout.c index 68ede902f..082c85ee9 100644 --- a/xkb/xkbout.c +++ b/xkb/xkbout.c @@ -353,9 +353,13 @@ XkbClientMapPtr map; XkbServerMapPtr srv; Bool showActions; + if (!xkb) { + _XkbLibError(_XkbErrMissingSymbols,"XkbWriteXKBSymbols",0); + return FALSE; + } + map= xkb->map; - srv= xkb->server; - if ((!xkb)||(!map)||(!map->syms)||(!map->key_sym_map)) { + if ((!map)||(!map->syms)||(!map->key_sym_map)) { _XkbLibError(_XkbErrMissingSymbols,"XkbWriteXKBSymbols",0); return FALSE; } @@ -376,6 +380,7 @@ Bool showActions; } if (tmp>0) fprintf(file,"\n"); + srv= xkb->server; for (i=xkb->min_key_code;i<=xkb->max_key_code;i++) { Bool simple; if ((int)XkbKeyNumSyms(xkb,i)<1) |