Skip to content

Commit 96df310

Browse files
committed
xkbcomp: Don't crash on no-op modmask expressions
If we have an expression of the form 'l1' in an interp section, we unconditionally try to dereference its args, even if it has none. Signed-off-by: Daniel Stone <daniels@collabora.com>
1 parent a8ea7a1 commit 96df310

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: src/xkbcomp/compat.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,8 @@ ResolveStateAndPredicate(ExprDef *expr, enum xkb_match_operation *pred_rtrn,
264264
*pred_rtrn = MATCH_EXACTLY;
265265
if (expr->expr.op == EXPR_ACTION_DECL) {
266266
const char *pred_txt = xkb_atom_text(info->ctx, expr->action.name);
267-
if (!LookupString(symInterpretMatchMaskNames, pred_txt, pred_rtrn)) {
267+
if (!LookupString(symInterpretMatchMaskNames, pred_txt, pred_rtrn) ||
268+
!expr->action.args) {
268269
log_err(info->ctx,
269270
"Illegal modifier predicate \"%s\"; Ignored\n", pred_txt);
270271
return false;

0 commit comments

Comments
 (0)