mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-03-31 11:10:50 +02:00
xkb: Fix serialization of key type without level names
Before this commit the count of key type level names was wrongly set
in `XkbGetNames`: for key type without names, it was set to the level
count, while it should be 0:
- `XkbComputeGetNamesReplySize()` does not account key type without
level names;
- `XkbSendNames()` does not write any level entry for key types without
level names.
This causes a mismatch offset while parsing the response and its
processing would ultimately fail.
Fixed by setting the correct level name count: 0 if there is no level
name, else the number of levels.
(cherry picked from commit c49cbc176a)
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2146>
This commit is contained in:
parent
bdc7eb8f07
commit
5ebf0a9dd7
1 changed files with 2 additions and 1 deletions
|
|
@ -3949,7 +3949,8 @@ XkbSendNames(ClientPtr client, XkbDescPtr xkb, xkbGetNamesReply * rep)
|
|||
register CARD32 *atm;
|
||||
|
||||
for (i = 0; i < rep->nTypes; i++, type++) {
|
||||
*desc++ = type->num_levels;
|
||||
/* Either no name or all of them, even empty ones */
|
||||
*desc++ = (type->level_names) ? type->num_levels : 0;
|
||||
}
|
||||
desc += XkbPaddedSize(rep->nTypes) - rep->nTypes;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue