xorg-x11-server/u_connection-avoid-crash-when-CloseWellKnownConnections-gets-called-twice.patch
Egbert Eich ebc18c5647 - Fix crash in abnormal condition (bnc#879666, bnc#879489):
* u_connection-avoid-crash-when-CloseWellKnownConnections-gets-called-twice.patch
    Fix a crash when CloseWellKnownConnections() gets called twice.
    This can happen if FatalError() is called in the shutdown procedure.
  * u_CloseConsole-Don-t-report-FatalError-when-shutting-down.patch
    Don't call FatalError() on errors in console ioctls when in shutdown.

OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/xorg-x11-server?expand=0&rev=518
2014-05-24 10:37:00 +00:00

34 lines
1.1 KiB
Diff

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