summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Le Marre <dev@wismill.eu>2025-08-13 11:47:26 +0200
committerPierre Le Marre <dev@wismill.eu>2025-08-13 11:50:34 +0200
commit7f80f2d077996bfc65e58c552a270cf6f97c1c1a (patch)
treecf6d79ce5088a18e13d5467b3a95eddb84822cbd
parent6ec3b544d6f2c32339062db3933c87c82ac2d2b2 (diff)
symbols: Fix NULL pointer dereference in MergeKeyGroupsHEADmaster
It may trigger with the following keymap symbols: key <> { [a, A] }; key <> { [NoAction()] }; or: key <> { [NoAction()] }; augment key <> { [a, A] }; Part-of: <https://gitlab.freedesktop.org/xorg/app/xkbcomp/-/merge_requests/33>
-rw-r--r--symbols.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/symbols.c b/symbols.c
index be306b6..d6c1907 100644
--- a/symbols.c
+++ b/symbols.c
@@ -414,6 +414,17 @@ MergeKeyGroups(SymbolsInfo * info,
{
resultActs[i] = *fromAct;
}
+ else if (toAct == NULL && fromAct == NULL)
+ {
+ /*
+ * May happen with e.g.:
+ *
+ * key <> { [a, A] }; key <> { [NoAction()] };
+ * or:
+ * key <> { [NoAction()] }; augment key <> { [a, A] };
+ */
+ resultActs[i].type = XkbSA_NoAction;
+ }
else
{
XkbAction *use, *ignore;