xkbcomp: where a keysym cannot be resolved, set it to NoSymbol
authorPeter Hutterer <peter.hutterer@who-t.net>
Mon, 19 Oct 2020 00:49:37 +0000 (10:49 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Mon, 19 Oct 2020 23:23:50 +0000 (09:23 +1000)
commitafdc9ceee707cba3164f892fc3309140480c9b82
tree2e85593d1e71fec8a20d37b2188bc88312f3c8a5
parent21e640fbc7ec2e53244e4e531ae7c32f249b023f
xkbcomp: where a keysym cannot be resolved, set it to NoSymbol

Where resolve_keysym fails we warn but use the otherwise uninitialized variable
as our keysym. That later ends up in the keymap as random garbage hex value.

Simplest test case, set this in the 'us' keymap:
    key <TLDE>               {      [        xyz ] };

And without this patch we get random garbage:
./build/xkbcli-compile-keymap --layout us | grep TLDE:
    key <TLDE>               {      [      0x018a5cf0 ] };

With this patch, we now get NoSymbol:
./build/xkbcli-compile-keymap --layout us | grep TLDE:
    key <TLDE>               {      [        NoSymbol ] };
src/xkbcomp/parser.y
test/data/symbols/garbage [new file with mode: 0644]
test/keymap.c