Commit 85039a0d76fc2af076aea24bd06d3af33625e9c3

Dan Nicholson 2009-04-04T12:31:55

xkbcomp: Give keymap file empty name if none supplied Ensure that the keymap file topName is not NULL since it gets blindly dereferenced later.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/src/xkbcomp/xkbcomp.c b/src/xkbcomp/xkbcomp.c
index 450c459..d2fa522 100644
--- a/src/xkbcomp/xkbcomp.c
+++ b/src/xkbcomp/xkbcomp.c
@@ -72,7 +72,8 @@ XkbKeymapFileFromComponents(const XkbComponentNamesPtr ktcsg)
     geometry = CreateXKBFile(XkmGeometryIndex, NULL, (ParseCommon *)inc, 0);
     AppendStmt(&keycodes->common, &geometry->common);
 
-    return CreateXKBFile(XkmKeymapFile, ktcsg->keymap, &keycodes->common, 0);
+    return CreateXKBFile(XkmKeymapFile, ktcsg->keymap ? ktcsg->keymap : "",
+                         &keycodes->common, 0);
 }
 
 static XkbComponentNamesPtr