mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-05-09 22:28:06 +02: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>
This commit is contained in:
parent
665e8a0c43
commit
0d27fbb67c
1 changed files with 3 additions and 3 deletions
|
|
@ -6025,6 +6025,9 @@ ProcXkbGetKbdByName(ClientPtr client)
|
|||
if (stuff->load && dev->hasDdxKeymap)
|
||||
return BadAccess;
|
||||
|
||||
CHK_MASK_LEGAL(0x01, stuff->want, XkbGBN_AllComponentsMask);
|
||||
CHK_MASK_LEGAL(0x02, stuff->need, XkbGBN_AllComponentsMask);
|
||||
|
||||
xkb = dev->key->xkbInfo->desc;
|
||||
status = Success;
|
||||
str = (unsigned char *) &stuff[1];
|
||||
|
|
@ -6055,9 +6058,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…
Add table
Reference in a new issue