Skip to content

Commit 38e1766

Browse files
committed
xkbcomp: Don't falsely promise from ExprResolveLhs
Every user of ExprReturnLhs goes on to unconditionally dereference the field return, which can be NULL if xkb_intern_atom fails. Return false if this is the case, so we fail safely. testcase: splice geometry data into interp Signed-off-by: Daniel Stone <daniels@collabora.com>
1 parent 4e2ee9c commit 38e1766

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/xkbcomp/expr.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ ExprResolveLhs(struct xkb_context *ctx, const ExprDef *expr,
4242
*elem_rtrn = NULL;
4343
*field_rtrn = xkb_atom_text(ctx, expr->ident.ident);
4444
*index_rtrn = NULL;
45-
return true;
45+
return (*field_rtrn != NULL);
4646
case EXPR_FIELD_REF:
4747
*elem_rtrn = xkb_atom_text(ctx, expr->field_ref.element);
4848
*field_rtrn = xkb_atom_text(ctx, expr->field_ref.field);

0 commit comments

Comments
 (0)