[PATCH] Don't crash when asked if a client that has disconnected was local

Simon Farnsworth simon.farnsworth at onelan.com
Mon Jun 21 09:38:07 PDT 2010

ProcDRI2Dispatch uses LocalClient to determine if it's safe to respond
to a client that has made DRI2 requests which aren't sensible for
remote clients (anything but version). When the client has disappeared
mid-request stream (e.g. as a result of a kill -9, or a client-side
bug), LocalClient causes the X server to follow suit, as
((OsCommPtr)client->osPrivate)->trans_conn is NULL at this point.

This is the simple and obvious fix - we don't care what the answer is,
so return FALSE on the grounds that it's unlikely to break anything.
 os/access.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/os/access.c b/os/access.c
index 5f485c9..ae166f6 100644
--- a/os/access.c
+++ b/os/access.c
@@ -1123,6 +1123,9 @@ Bool LocalClient(ClientPtr client)
     pointer		addr;
     register HOST	*host;
+    if (!((OsCommPtr)client->osPrivate)->trans_conn)
+        return FALSE;
     if (!_XSERVTransGetPeerAddr (((OsCommPtr)client->osPrivate)->trans_conn,
 	&notused, &alen, &from))

More information about the xorg-devel mailing list