xserver/os
Simon Farnsworth 7787526a71 Don't crash when asked if a client that has disconnected was local
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.

The simple and obvious fix is to just return "not local" when
trans_conn is NULL, which fixes the crash I was seeing; however Keith
Packard pointed out that just checking trans_conn isn't enough;
quoting Keith:

"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."

Signed-off-by: Simon Farnsworth <simon.farnsworth@onelan.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 660f6ab549)
2010-08-21 14:01:10 -07:00
..
access.c Don't crash when asked if a client that has disconnected was local 2010-08-21 14:01:10 -07:00
auth.c Rework symbol visibility for easier maintenance 2008-12-03 05:43:34 -02:00
backtrace.c os: don't redefine GNU_SOURCE 2009-09-04 12:51:02 +10:00
connection.c XQuartz: Fix possible NULL dereference in ListenOnOpenFD 2010-04-15 14:13:22 -07:00
io.c os: silence bigreqsproto compiler warning 2009-09-04 12:51:02 +10:00
log.c os: don't malloc memory in LogVMessageVerb. 2009-04-19 22:20:18 +10:00
Makefile.am Add platform tests for Dtrace linker magic 2009-10-07 17:24:03 -07:00
mitauth.c Remove a bunch of useless casts. 2009-01-22 02:11:16 -05:00
oscolor.c Rework symbol visibility for easier maintenance 2008-12-03 05:43:34 -02:00
osdep.h Bug 16832: XDMCP related build error when --disable-xdmcp is used 2009-08-03 20:58:37 -07:00
osinit.c linux: Yet more malloc() avoidance for backtrace() 2009-08-20 15:43:55 -04:00
rpcauth.c Remove a bunch of useless casts. 2009-01-22 02:11:16 -05:00
strcasecmp.c Rework symbol visibility for easier maintenance 2008-12-03 05:43:34 -02:00
strcasestr.c Rework symbol visibility for easier maintenance 2008-12-03 05:43:34 -02:00
strlcat.c Rework symbol visibility for easier maintenance 2008-12-03 05:43:34 -02:00
strlcpy.c Rework symbol visibility for easier maintenance 2008-12-03 05:43:34 -02:00
utils.c os: state effect of -a and -t options more precisely 2010-01-19 17:36:10 +13:00
WaitFor.c Update to xextproto 7.0.99.1. 2009-07-15 17:00:05 +10:00
xdmauth.c Remove a bunch of useless casts. 2009-01-22 02:11:16 -05:00
xdmcp.c xdmcp: Don't crash on X -query with more than 255 IP addresses. (#20675) 2009-04-14 10:57:19 -04:00
xprintf.c Rework symbol visibility for easier maintenance 2008-12-03 05:43:34 -02:00
xstrans.c Change HAVE_CONFIG_H to HAVE_DIX_CONFIG_H. 2005-07-03 12:16:29 +00:00