Author: metze
Date: 2005-01-10 12:14:26 +0000 (Mon, 10 Jan 2005)
New Revision: 4639

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=4639

Log:
initialize all struct members!

tridge: sorry for making you such a pain...
        could you check if that fixes your bugs

metze

Modified:
   branches/SAMBA_4_0/source/rpc_server/netlogon/dcerpc_netlogon.c


Changeset:
Modified: branches/SAMBA_4_0/source/rpc_server/netlogon/dcerpc_netlogon.c
===================================================================
--- branches/SAMBA_4_0/source/rpc_server/netlogon/dcerpc_netlogon.c     
2005-01-10 12:12:44 UTC (rev 4638)
+++ branches/SAMBA_4_0/source/rpc_server/netlogon/dcerpc_netlogon.c     
2005-01-10 12:14:26 UTC (rev 4639)
@@ -563,21 +563,21 @@
        sam->group_count = 0;
        sam->groupids = NULL;
        sam->user_flags = 0; /* TODO: w2k3 uses 0x120 - what is this? */
-       sam->acct_flags = server_info->acct_flags;      
+       sam->acct_flags = server_info->acct_flags;
        sam->logon_server.string = lp_netbios_name();
-
        sam->domain.string = server_info->domain_name;
 
        sam->domain_sid = dom_sid_dup(mem_ctx, server_info->account_sid);
        NT_STATUS_HAVE_NO_MEMORY(sam->domain_sid);
        sam->domain_sid->num_auths--;
 
+       ZERO_ARRAY(sam->unknown);
+
+       ZERO_STRUCT(sam->key);
        if (server_info->user_session_key.length == sizeof(sam->key.key)) {
                memcpy(sam->key.key, server_info->user_session_key.data, 
sizeof(sam->key.key));
-       } else {
-               ZERO_STRUCT(sam->key.key);
        }
-       
+
        /* Don't crypt an all-zero key, it would give away the NETLOGON pipe 
session key */
        /* It appears that level 6 is not individually encrypted */
        if ((r->in.validation_level != 6) 
@@ -591,12 +591,11 @@
                                            sizeof(sam->key.key));
                }
        }
-       
+
+       ZERO_STRUCT(sam->LMSessKey);
        if (server_info->lm_session_key.length == sizeof(sam->LMSessKey.key)) {
                memcpy(sam->LMSessKey.key, server_info->lm_session_key.data, 
                       sizeof(sam->LMSessKey.key));
-       } else {
-               ZERO_STRUCT(sam->LMSessKey.key);
        }
        
        /* Don't crypt an all-zero key, it would give away the NETLOGON pipe 
session key */

Reply via email to