Commit fdd8a9ec1b966785c2ff0e7124d485d323101b18

Dan Nicholson 2009-04-04T12:17:50

xkbcomp: Don't dereference NULL VarDefsPtr

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/xkbcomp/xkbcomp.c b/src/xkbcomp/xkbcomp.c
index 4adb4be..3cfde6a 100644
--- a/src/xkbcomp/xkbcomp.c
+++ b/src/xkbcomp/xkbcomp.c
@@ -117,7 +117,7 @@ XkbcCompileKeymapFromRules(const char *rules, XkbRF_VarDefsPtr defs)
     XkbComponentNamesPtr names;
     XkbcDescPtr xkb;
 
-    if (ISEMPTY(rules) || ISEMPTY(defs->layout)) {
+    if (ISEMPTY(rules) || !defs || ISEMPTY(defs->layout)) {
         ERROR("rules and layout required to generate XKB keymap\n");
         return NULL;
     }