xkbcomp: Give keymap file empty name if none supplied
authorDan Nicholson <dbn.lists@gmail.com>
Sat, 4 Apr 2009 19:31:55 +0000 (12:31 -0700)
committerDan Nicholson <dbn.lists@gmail.com>
Sat, 4 Apr 2009 19:31:55 +0000 (12:31 -0700)
Ensure that the keymap file topName is not NULL since it gets blindly
dereferenced later.

src/xkbcomp/xkbcomp.c

index 450c459..d2fa522 100644 (file)
@@ -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