xkbcomp: Ensure at least keycodes supplied in components
authorDan Nicholson <dbn.lists@gmail.com>
Sat, 4 Apr 2009 19:21:05 +0000 (12:21 -0700)
committerDan Nicholson <dbn.lists@gmail.com>
Sat, 4 Apr 2009 19:21:05 +0000 (12:21 -0700)
It seems that at least a non-empty keycodes component is required to
compile a XkbcDescPtr.

src/xkbcomp/xkbcomp.c

index 3cfde6a573f88b991122a66e61fe933708439c6c..450c4594fac6b96ea15cf61fe22e2a610ece19cf 100644 (file)
@@ -155,6 +155,11 @@ XkbcCompileKeymapFromComponents(XkbComponentNamesPtr ktcsg)
     XkbFile *file, *mapToUse;
     XkbcDescPtr xkb;
 
+    if (!ktcsg || ISEMPTY(ktcsg->keycodes)) {
+        ERROR("keycodes required to generate XKB keymap\n");
+        goto fail;
+    }
+
     if (!(file = XkbKeymapFileFromComponents(ktcsg))) {
         ERROR("failed to generate parsed XKB file from components\n");
         goto fail;