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