xkbcomp: Give keymap file empty name if none supplied Ensure that the keymap file topName is not NULL since it gets blindly dereferenced later.
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