xserver: Branch 'master'

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Sep 24 07:56:33 UTC 2024


 os/access.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 57a446c0f98693bd2e0263e91213344d870f4e03
Author: Olivier Fourdan <ofourdan at redhat.com>
Date:   Mon Sep 23 09:27:21 2024 +0200

    os: Fix NULL pointer dereference
    
    RemoveHost() can be called from DisableLocalHost() with a NULL client,
    but doesn't actually check whether the given client pointer is valid on
    error and assigns the error value unconditionally, leading to a possible
    NULL pointer dereference and a crash of the Xserver.
    
    To avoid the issue, simply check whether the client pointer is not NULL
    prior to assign the errorValue.
    
    Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1752
    See-also: https://bugzilla.redhat.com/2313799
    Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
    Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1701>

diff --git a/os/access.c b/os/access.c
index bacdee432..abf099cf6 100644
--- a/os/access.c
+++ b/os/access.c
@@ -1372,13 +1372,15 @@ RemoveHost(ClientPtr client, int family, unsigned length,       /* of bytes in p
     case FamilyChaos:
     case FamilyServerInterpreted:
         if ((len = CheckAddr(family, pAddr, length)) < 0) {
-            client->errorValue = length;
+            if (client)
+                client->errorValue = length;
             return BadValue;
         }
         break;
     case FamilyLocal:
     default:
-        client->errorValue = family;
+        if (client)
+            client->errorValue = family;
         return BadValue;
     }
     for (prev = &validhosts;


More information about the xorg-commit mailing list