Add back the not null checks in a better place.
authorAndrew Bartlett <abartlet@samba.org>
Sun, 11 Nov 2001 11:18:45 +0000 (11:18 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Sun, 11 Nov 2001 11:18:45 +0000 (11:18 +0000)
Check the pdb_init_sam() for failure.
(This used to be commit 1808cd5210258bddc349f13a7bcf20a3f46aa672)

source3/auth/auth_sam.c
source3/smbd/auth_smbpasswd.c

index 717e30eda7378ea07cca9b9c50fd11eca4d44c0c..70632fb5dfb46b9bb2fee081a497f07b745f9840 100644 (file)
@@ -344,7 +344,13 @@ NTSTATUS check_smbpasswd_security(const auth_usersupplied_info *user_info, auth_
        uint8 user_sess_key[16];
        const uint8* lm_hash;
 
-       pdb_init_sam(&sampass);
+       if (!user_info) {
+               return NT_STATUS_LOGON_FAILURE;
+       }
+
+       if (!pdb_init_sam(&sampass)) {
+               return NT_STATUS_NO_MEMORY;
+       }
 
        /* get the account information */
 
index 717e30eda7378ea07cca9b9c50fd11eca4d44c0c..70632fb5dfb46b9bb2fee081a497f07b745f9840 100644 (file)
@@ -344,7 +344,13 @@ NTSTATUS check_smbpasswd_security(const auth_usersupplied_info *user_info, auth_
        uint8 user_sess_key[16];
        const uint8* lm_hash;
 
-       pdb_init_sam(&sampass);
+       if (!user_info) {
+               return NT_STATUS_LOGON_FAILURE;
+       }
+
+       if (!pdb_init_sam(&sampass)) {
+               return NT_STATUS_NO_MEMORY;
+       }
 
        /* get the account information */