don't use server_info after its been freed
authorAndrew Tridgell <tridge@samba.org>
Thu, 20 Dec 2001 09:32:03 +0000 (09:32 +0000)
committerAndrew Tridgell <tridge@samba.org>
Thu, 20 Dec 2001 09:32:03 +0000 (09:32 +0000)
(This used to be commit ee161a57289409e2fa43e33b045473077c7b6ba5)

source3/smbd/sesssetup.c

index 7fd0fd917aa784351b169f31a29365975806b41e..8424e0e186d36647e1e49e3e951eaaa0ce06ff40 100644 (file)
@@ -325,6 +325,7 @@ static int reply_spnego_auth(connection_struct *conn, char *inbuf, char *outbuf,
        uint32 ntlmssp_command, neg_flags;
        NTSTATUS nt_status;
        int sess_vuid;
+       BOOL as_guest;
 
        auth_usersupplied_info *user_info = NULL;
        auth_serversupplied_info *server_info = NULL;
@@ -392,8 +393,9 @@ static int reply_spnego_auth(connection_struct *conn, char *inbuf, char *outbuf,
                return ERROR_NT(nt_status_squash(nt_status));
        }
 
-       sess_vuid = register_vuid(server_info, user);
+       as_guest = server_info->guest;
 
+       sess_vuid = register_vuid(server_info, user);
        free_server_info(&server_info);
 
        SAFE_FREE(user);
@@ -405,7 +407,7 @@ static int reply_spnego_auth(connection_struct *conn, char *inbuf, char *outbuf,
        set_message(outbuf,4,0,True);
        SSVAL(outbuf, smb_vwv3, 0);
 
-       if (server_info->guest) {
+       if (as_guest) {
                SSVAL(outbuf,smb_vwv2,1);
        }