[gdm] Fix an obvious use-after-free in the XDMCP code



commit 51443645f2e394c1f138fd285fbbe56962d34779
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Apr 28 19:57:32 2009 -0400

    Fix an obvious use-after-free in the XDMCP code
    
    The patch was provided by Michael Young in rhbz#496882.
---
 daemon/gdm-xdmcp-display-factory.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/daemon/gdm-xdmcp-display-factory.c b/daemon/gdm-xdmcp-display-factory.c
index 724717c..1d33b44 100644
--- a/daemon/gdm-xdmcp-display-factory.c
+++ b/daemon/gdm-xdmcp-display-factory.c
@@ -2309,8 +2309,6 @@ gdm_xdmcp_handle_request (GdmXdmcpDisplayFactory *factory,
                                 authorization_data.data     = (CARD8 *) cookie->data;
                                 authorization_data.length   = cookie->len;
 
-                                g_array_free (cookie, TRUE);
-
                                 /* the addrs are NOT copied */
                                 gdm_xdmcp_send_accept (factory,
                                                        address,
@@ -2319,6 +2317,8 @@ gdm_xdmcp_handle_request (GdmXdmcpDisplayFactory *factory,
                                                        &authentication_data,
                                                        &authorization_name,
                                                        &authorization_data);
+
+                                g_array_free (cookie, TRUE);
                         }
                 }
         } else {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]