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

Keith Packard keithp at keithp.com
Mon Jun 21 17:25:54 PDT 2010

On Mon, 21 Jun 2010 17:38:07 +0100, Simon Farnsworth <simon.farnsworth at onelan.com> wrote:
> +    if (!((OsCommPtr)client->osPrivate)->trans_conn)
> +        return FALSE;
> +

This looks almost right to me -- I reviewed the os code to see when
_XSERVTransClose is called (which is what frees the trans_conn data) and
found that every place which called that immediately set trans_conn to
NULL, except for the call in CloseDownFileDescriptor which is only
called from CloseDownConnection and which is immediately followed by
freeing the OsCommRec and setting client->osPrivate to NULL. So, I'd
suggest checking client->osPrivate in addition to the above check.

keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20100621/7d70acc4/attachment.pgp>

More information about the xorg-devel mailing list