Commit 4e2ee9c3f6050d773f8bbe05bc0edb17f1ff8371

Daniel Stone 2017-06-26T17:18:16

xkbcomp: Don't explode on invalid virtual modifiers testcase: 'virtualModifiers=LevelThreC' Signed-off-by: Daniel Stone <daniels@collabora.com>

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/xkbcomp/expr.c b/src/xkbcomp/expr.c
index 5d43cba..91713da 100644
--- a/src/xkbcomp/expr.c
+++ b/src/xkbcomp/expr.c
@@ -101,6 +101,8 @@ LookupModMask(struct xkb_context *ctx, const void *priv, xkb_atom_t field,
         return false;
 
     str = xkb_atom_text(ctx, field);
+    if (!str)
+        return false;
 
     if (istreq(str, "all")) {
         *val_rtrn  = MOD_REAL_MASK_ALL;