From 125ce76f5b10e58c75e9a242362f57856b4aaf4f Mon Sep 17 00:00:00 2001 From: Dan Nicholson Date: Sat, 4 Apr 2009 12:21:05 -0700 Subject: [PATCH] xkbcomp: Ensure at least keycodes supplied in components It seems that at least a non-empty keycodes component is required to compile a XkbcDescPtr. --- src/xkbcomp/xkbcomp.c | 5 +++++ 1 file changed, 5 insertions(+) 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; -- 2.34.1