Commit 125ce76f5b10e58c75e9a242362f57856b4aaf4f

Dan Nicholson 2009-04-04T12:21:05

xkbcomp: Ensure at least keycodes supplied in components It seems that at least a non-empty keycodes component is required to compile a XkbcDescPtr.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/src/xkbcomp/xkbcomp.c b/src/xkbcomp/xkbcomp.c
index 3cfde6a..450c459 100644
--- a/src/xkbcomp/xkbcomp.c
+++ b/src/xkbcomp/xkbcomp.c
@@ -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;