mirror of
https://github.com/X11Libre/xserver.git
synced 2026-10-26 01:59:57 +00:00
Xi: avoid memory leak when hitting bounds check for barrier events
The fix for CVE-2026-93519 added a bounds check for barrier events in CreatePointerBarrierClient() and if it's hit immediately returns BadAlloc. Unfortunately it was added after `ret` was already allocated and before *client_out is set to `ret`, so `ret` leaks. This fix changes it to jump to the same cleanup code to free(ret) that the rest of the function already uses. Fixes:1f42cc1f0("Xi: add bounds check for barrier events in input_constrain_cursor") Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2352> (cherry picked from commit8e901e6013)
This commit is contained in:
parent
fe86e4fc94
commit
236681603b
1 changed files with 4 additions and 2 deletions
|
|
@ -604,8 +604,10 @@ CreatePointerBarrierClient(ClientPtr client,
|
|||
* function */
|
||||
xorg_list_for_each_entry(counter, &cs->barriers, entry) {
|
||||
nbarriers++;
|
||||
if (nbarriers >= 32)
|
||||
return BadAlloc;
|
||||
if (nbarriers >= 32) {
|
||||
err = BadAlloc;
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
ret->pScreen = pScreen;
|
||||
|
|
|
|||
Loading…
Reference in a new issue