mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-20 04:40:02 +01:00
dix: handle allocation failure in DeviceFocusEvent()
Reported in #1817:
xwayland-24.1.6/redhat-linux-build/../dix/enterleave.c:786:5:
warning[-Wanalyzer-possible-null-dereference]:
dereference of possibly-NULL ‘xi2event’
Fixes: 3f37923a7 ("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:
parent
7e6c55cc9f
commit
dedceb52bc
1 changed files with 1 additions and 0 deletions
|
|
@ -783,6 +783,7 @@ DeviceFocusEvent(DeviceIntPtr dev, int type, int mode, int detail,
|
||||||
len = sizeof(xXIFocusInEvent) + btlen * 4;
|
len = sizeof(xXIFocusInEvent) + btlen * 4;
|
||||||
|
|
||||||
xi2event = calloc(1, len);
|
xi2event = calloc(1, len);
|
||||||
|
BUG_RETURN(xi2event == NULL);
|
||||||
xi2event->type = GenericEvent;
|
xi2event->type = GenericEvent;
|
||||||
xi2event->extension = IReqCode;
|
xi2event->extension = IReqCode;
|
||||||
xi2event->evtype = type;
|
xi2event->evtype = type;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue