Blame SOURCES/0002-xkbcomp-Don-t-crash-on-no-op-modmask-expressions.patch

c4524d
From c544a0174669ac2f3b2730f838d36dc8f642079d Mon Sep 17 00:00:00 2001
c4524d
From: Daniel Stone <daniels@collabora.com>
c4524d
Date: Mon, 26 Jun 2017 17:12:29 +0100
c4524d
Subject: [PATCH 02/10] xkbcomp: Don't crash on no-op modmask expressions
c4524d
c4524d
If we have an expression of the form 'l1' in an interp section, we
c4524d
unconditionally try to dereference its args, even if it has none.
c4524d
c4524d
Signed-off-by: Daniel Stone <daniels@collabora.com>
c4524d
(cherry picked from commit 96df3106d49438e442510c59acad306e94f3db4d)
c4524d
---
c4524d
 src/xkbcomp/compat.c | 3 ++-
c4524d
 1 file changed, 2 insertions(+), 1 deletion(-)
c4524d
c4524d
diff --git a/src/xkbcomp/compat.c b/src/xkbcomp/compat.c
c4524d
index 9ae26cd..bd587c8 100644
c4524d
--- a/src/xkbcomp/compat.c
c4524d
+++ b/src/xkbcomp/compat.c
c4524d
@@ -264,7 +264,8 @@ ResolveStateAndPredicate(ExprDef *expr, enum xkb_match_operation *pred_rtrn,
c4524d
     *pred_rtrn = MATCH_EXACTLY;
c4524d
     if (expr->expr.op == EXPR_ACTION_DECL) {
c4524d
         const char *pred_txt = xkb_atom_text(info->ctx, expr->action.name);
c4524d
-        if (!LookupString(symInterpretMatchMaskNames, pred_txt, pred_rtrn)) {
c4524d
+        if (!LookupString(symInterpretMatchMaskNames, pred_txt, pred_rtrn) ||
c4524d
+            !expr->action.args) {
c4524d
             log_err(info->ctx,
c4524d
                     "Illegal modifier predicate \"%s\"; Ignored\n", pred_txt);
c4524d
             return false;
c4524d
--
c4524d
2.20.1