mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-24 16:00:05 +01:00
Xext/xres: avoid null dereference in ProcXResQueryClients()
Reported in #1817:
xwayland-24.1.6/redhat-linux-build/../Xext/xres.c:233:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘current_clients’
xwayland-24.1.6/redhat-linux-build/../Xext/xres.c:228:23: acquire_memory: this call could return NULL
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
(cherry picked from commit 3da60c96a9)
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2076>
This commit is contained in:
parent
ed27eefea9
commit
5cc2631e89
1 changed files with 2 additions and 0 deletions
|
|
@ -226,6 +226,8 @@ ProcXResQueryClients(ClientPtr client)
|
|||
REQUEST_SIZE_MATCH(xXResQueryClientsReq);
|
||||
|
||||
current_clients = xallocarray(currentMaxClients, sizeof(int));
|
||||
if (current_clients == NULL)
|
||||
return BadAlloc;
|
||||
|
||||
num_clients = 0;
|
||||
for (i = 0; i < currentMaxClients; i++) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue