1
0
xorg-x11-server/u_connection-avoid-crash-when-CloseWellKnownConnections-gets-called-twice.patch

34 lines
1.1 KiB
Diff
Raw Normal View History

From: Egbert Eich <eich@suse.de>
Date: Fri May 23 20:08:29 2014 +0200
Subject: [PATCH]connection: avoid crash when CloseWellKnownConnections() gets called twice
Patch-mainline: to be upstreamed
Git-commit: 74472c4e8e4c873014554f321ec2086066126297
Git-repo:
References: bnc#879666, bnc#879489
Signed-off-by: Egbert Eich <eich@suse.com>
CloseWellKnownConnections() closes all connections and deallocates
their data. Thus all entries in ListenTransConns are invalid.
To avoid access to those entries set ListenTransCount to 0.
This avoids crashes when CloseWellKnownConnections() is called twice
for instance when FatalError() is called on Xserver shutdown.
Signed-off-by: Egbert Eich <eich@suse.de>
---
os/connection.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/os/connection.c b/os/connection.c
index 162e1d9..3c0b62a 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -513,6 +513,8 @@ CloseWellKnownConnections(void)
for (i = 0; i < ListenTransCount; i++)
_XSERVTransClose(ListenTransConns[i]);
+
+ ListenTransCount = 0;
}
static void