xkbcomp: Don't dereference NULL VarDefsPtr
authorDan Nicholson <dbn.lists@gmail.com>
Sat, 4 Apr 2009 19:17:50 +0000 (12:17 -0700)
committerDan Nicholson <dbn.lists@gmail.com>
Sat, 4 Apr 2009 19:17:50 +0000 (12:17 -0700)
src/xkbcomp/xkbcomp.c

index 4adb4be..3cfde6a 100644 (file)
@@ -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;
     }