diff options
author | Daniel Stone <daniel@fooishbar.org> | 2006-04-07 15:58:58 +0000 |
---|---|---|
committer | Daniel Stone <daniel@fooishbar.org> | 2006-04-07 15:58:58 +0000 |
commit | bf3fad9eff30bba4587548303dd3d96f3da5d494 (patch) | |
tree | 44f1c25f5009cfc1746e71b858a484315b5ea9b2 | |
parent | 25e8b874b9f58e5e8035957465252539df13a85d (diff) |
Coverity #982: Fix potential NULL dereference.
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | src/xkbout.c | 11 |
2 files changed, 10 insertions, 4 deletions
@@ -3,6 +3,9 @@ * src/maprules.c: Fix signed vs unsigned char hilarity. (Bill Crawford) + * src/xkbout.c: + Coverity #982: Fix potential NULL dereference. + 2006-03-27 Daniel Stone <daniel@freedesktop.org> * configure.ac: diff --git a/src/xkbout.c b/src/xkbout.c index b69fdfb..7f8c8b5 100644 --- a/src/xkbout.c +++ b/src/xkbout.c @@ -392,10 +392,8 @@ XkbServerMapPtr srv; Bool showActions; xkb= result->xkb; - map= xkb->map; - srv= xkb->server; - dpy= xkb->dpy; - if ((!xkb)||(!map)||(!map->syms)||(!map->key_sym_map)) { + + if ((!xkb)||(!xkb->map)||(!xkb->map->syms)||(!xkb->map->key_sym_map)) { _XkbLibError(_XkbErrMissingSymbols,"XkbWriteXKBSymbols",0); return False; } @@ -403,6 +401,11 @@ Bool showActions; _XkbLibError(_XkbErrMissingNames,"XkbWriteXKBSymbols",0); return False; } + + map= xkb->map; + srv= xkb->server; + dpy= xkb->dpy; + if ((xkb->names==NULL)||(xkb->names->symbols==None)) fprintf(file,"xkb_symbols {\n\n"); else fprintf(file,"xkb_symbols \"%s\" {\n\n", |