[PATCH] xkb: check for NULL pointer before dereferences it in XkbWriteXKBSymbols

Tiago Vignatti tiago.vignatti at nokia.com
Mon Apr 19 10:58:06 PDT 2010


just moved the srv assignment to before it's being used.
---
 xkb/xkbout.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xkb/xkbout.c b/xkb/xkbout.c
index 68ede90..9daac9a 100644
--- a/xkb/xkbout.c
+++ b/xkb/xkbout.c
@@ -354,7 +354,6 @@ XkbServerMapPtr		srv;
 Bool			showActions;
 
     map= xkb->map;
-    srv= xkb->server;
     if ((!xkb)||(!map)||(!map->syms)||(!map->key_sym_map)) {
 	_XkbLibError(_XkbErrMissingSymbols,"XkbWriteXKBSymbols",0);
 	return FALSE;
@@ -376,6 +375,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)
-- 
1.6.0.4



More information about the xorg-devel mailing list