[Xfce4-commits] <libxfcegui4:xfce-4.6> session-client: fix SEGV inside disconnect() helper

Brian J. Tarricone noreply at xfce.org
Sat Oct 24 22:12:01 CEST 2009


Updating branch refs/heads/xfce-4.6
         to f2053a1e2db56c3f1f92e230140de4fe6ba04f48 (commit)
       from caffa2a1e66f44d63ea201f186d5fd0c5337f4bf (commit)

commit f2053a1e2db56c3f1f92e230140de4fe6ba04f48
Author: Eygene Ryabinkin <rea-xfce at codelabs.ru>
Date:   Sat Oct 24 23:23:42 2009 +0400

    session-client: fix SEGV inside disconnect() helper
    
    Don't call SmcCloseConnection if no connection is present: we will
    dereference NULL-pointer in this case and this will provoke SEGV
    
    I had seen this problem when I tried to start xfce4 settings-helper
    without running session manager: it whined that
    -----
    (xfce4-settings-helper:86452): xfce4-settings-helper-WARNING **:
    Failed to connect to session manager
    -----
    and dumped core afterwards.  With this patch I can run the utility
    without session manager.  May be the other clients of libxfcegui4
    were affected -- don't currently know.
    
    Signed-off-by: Eygene Ryabinkin <rea-xfce at codelabs.ru>

 libxfcegui4/session-client.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/libxfcegui4/session-client.c b/libxfcegui4/session-client.c
index 3c63904..c9c1137 100644
--- a/libxfcegui4/session-client.c
+++ b/libxfcegui4/session-client.c
@@ -335,9 +335,11 @@ logout_session (SessionClient * session_client)
 static void
 disconnect (SessionClient * session_client)
 {
-    SmcCloseConnection ((SmcConn) session_client->session_connection, 0,
-                        NULL);
-    session_client->session_connection = NULL;
+    if (session_client->session_connection != NULL) {
+            SmcCloseConnection ((SmcConn) session_client->session_connection,
+                                0, NULL);
+            session_client->session_connection = NULL;
+    }
     session_client->current_state = SESSION_CLIENT_DISCONNECTED;
     gdk_set_sm_client_id (NULL);
 }



More information about the Xfce4-commits mailing list