[PATCH libxkbfile 08/12] Fix possible NULL pointer dereference

Pauli Nieminen ext-pauli.nieminen at nokia.com
Wed Jul 21 05:02:52 PDT 2010


xkb->server is checked for NULL in previous if but then derefenreced
unconditionaly.

Signed-off-by: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
---
 src/xkmout.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/xkmout.c b/src/xkmout.c
index 6cb5810..d4bebd3 100644
--- a/src/xkmout.c
+++ b/src/xkmout.c
@@ -597,7 +597,8 @@ unsigned		tmp,size= 0;
 	}
 	tmp= fwrite(&wireMap,SIZEOF(xkmKeySymMapDesc),1,file);
 	size+= tmp*SIZEOF(xkmKeySymMapDesc);
-	if (xkb->server->explicit[i]&XkbExplicitKeyTypesMask) {
+	if (xkb->server
+	    && xkb->server->explicit[i]&XkbExplicitKeyTypesMask) {
 	    register int g;
 	    for (g=0;g<XkbNumKbdGroups;g++) {
 		if (typeName[g]!=NULL)
-- 
1.6.3.3



More information about the xorg-devel mailing list