Blob Blame History Raw
From 55f9df15b30deb0477b8dbcb837f525773705273 Mon Sep 17 00:00:00 2001
From: Daniel Stone <daniels@collabora.com>
Date: Mon, 26 Jun 2017 17:18:16 +0100
Subject: [PATCH 03/10] xkbcomp: Don't explode on invalid virtual modifiers

testcase: 'virtualModifiers=LevelThreC'

Signed-off-by: Daniel Stone <daniels@collabora.com>
(cherry picked from commit 4e2ee9c3f6050d773f8bbe05bc0edb17f1ff8371)
---
 src/xkbcomp/expr.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/xkbcomp/expr.c b/src/xkbcomp/expr.c
index a85f460..d5dd62f 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;
--
2.20.1