mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 08:04:30 +00:00
dix: handle allocation failure in DeviceFocusEvent()
Reported in https://gitlab.freedesktop.org/xorg/xserver/-/issues/1817:
xwayland-24.1.6/redhat-linux-build/../dix/enterleave.c:786:5:
warning[-Wanalyzer-possible-null-dereference]:
dereference of possibly-NULL ‘xi2event’
Fixes: 3f37923a72 ("Xi: send XI2 focus events." in Xorg 1.10.0)
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2078>
This commit is contained in:
committed by
Enrico Weigelt, metux IT consult
parent
a1f3edddf4
commit
e352fdecfe
@@ -774,8 +774,7 @@ DeviceFocusEvent(DeviceIntPtr dev, int type, int mode, int detail,
|
||||
len = sizeof(xXIFocusInEvent) + btlen * 4;
|
||||
|
||||
xXIFocusInEvent *xi2event = calloc(1, len);
|
||||
if (!xi2event)
|
||||
return;
|
||||
BUG_RETURN(xi2event == NULL);
|
||||
|
||||
xi2event->type = GenericEvent;
|
||||
xi2event->extension = EXTENSION_MAJOR_XINPUT;
|
||||
|
||||
Reference in New Issue
Block a user