mirror of
https://github.com/X11Libre/xserver.git
synced 2026-11-14 05:14:45 +00:00
xkb: fix client-triggerable memory leak in ProcXkbGetKbdByName
CHK_MASK_LEGAL expands to 'return BadValue' when the check fails and doesn't clean up the already allocated names.keycodes, names.types, etc. Move the check up so we don't need any cleanup code. Co-Authored-by: Claude Code <noreply@anthropic.com> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2184> Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
5f920bc8d4
commit
6b1bbabe7f
1 changed files with 3 additions and 3 deletions
|
|
@ -5900,6 +5900,9 @@ ProcXkbGetKbdByName(ClientPtr client)
|
|||
if (!(client->xkbClientFlags & _XkbClientInitialized))
|
||||
return BadAccess;
|
||||
|
||||
CHK_MASK_LEGAL(0x01, stuff->want, XkbGBN_AllComponentsMask);
|
||||
CHK_MASK_LEGAL(0x02, stuff->need, XkbGBN_AllComponentsMask);
|
||||
|
||||
CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, access_mode);
|
||||
master = GetMaster(dev, MASTER_KEYBOARD);
|
||||
|
||||
|
|
@ -5937,9 +5940,6 @@ ProcXkbGetKbdByName(ClientPtr client)
|
|||
return status;
|
||||
}
|
||||
|
||||
CHK_MASK_LEGAL(0x01, stuff->want, XkbGBN_AllComponentsMask);
|
||||
CHK_MASK_LEGAL(0x02, stuff->need, XkbGBN_AllComponentsMask);
|
||||
|
||||
if (stuff->load)
|
||||
fwant = XkbGBN_AllComponentsMask;
|
||||
else
|
||||
|
|
|
|||
Loading…
Reference in a new issue