mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-02-06 23:20:40 +01:00
Check for OOM condition in XISendDeviceHierarchyEvent
When system is out of memory, calloc can fail returning a NULL pointer. Check for this before dereferencing it, and bail out if it fails. Ref.: https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/720445 Signed-off-by: Bryce Harrington <bryce@canonical.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
31ddb7ef4f
commit
649269d406
1 changed files with 2 additions and 0 deletions
|
|
@ -70,6 +70,8 @@ void XISendDeviceHierarchyEvent(int flags[MAXDEVICES])
|
|||
|
||||
ev = calloc(1, sizeof(xXIHierarchyEvent) +
|
||||
MAXDEVICES * sizeof(xXIHierarchyInfo));
|
||||
if (!ev)
|
||||
return;
|
||||
ev->type = GenericEvent;
|
||||
ev->extension = IReqCode;
|
||||
ev->evtype = XI_HierarchyChanged;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue