The branch, v3-5-test has been updated
       via  386a462... s3-samr: Fix crash bug in _samr_QueryUserInfo{2} level 
18.
      from  73d4135... s3-selftest: enable RPC-WINREG against s3.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-5-test


- Log -----------------------------------------------------------------
commit 386a4621b8c9e8f7956320a44679789b731d7b10
Author: Günther Deschner <[email protected]>
Date:   Fri May 28 14:11:53 2010 +0200

    s3-samr: Fix crash bug in _samr_QueryUserInfo{2} level 18.
    
    Guenther
    
    Fix bug #7479 (Crash bug in _samr_QueryUserInfo{2} level 18.)

-----------------------------------------------------------------------

Summary of changes:
 source3/rpc_server/srv_samr_nt.c |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c
index d50c6c3..e98e4aa 100644
--- a/source3/rpc_server/srv_samr_nt.c
+++ b/source3/rpc_server/srv_samr_nt.c
@@ -2735,6 +2735,8 @@ static NTSTATUS get_user_info_18(pipes_struct *p,
 {
        struct samu *smbpass=NULL;
        bool ret;
+       const uint8_t *nt_pass = NULL;
+       const uint8_t *lm_pass = NULL;
 
        ZERO_STRUCTP(r);
 
@@ -2769,10 +2771,17 @@ static NTSTATUS get_user_info_18(pipes_struct *p,
                return NT_STATUS_ACCOUNT_DISABLED;
        }
 
-       r->lm_pwd_active = true;
-       r->nt_pwd_active = true;
-       memcpy(r->lm_pwd.hash, pdb_get_lanman_passwd(smbpass), 16);
-       memcpy(r->nt_pwd.hash, pdb_get_nt_passwd(smbpass), 16);
+       lm_pass = pdb_get_lanman_passwd(smbpass);
+       if (lm_pass != NULL) {
+               memcpy(r->lm_pwd.hash, lm_pass, 16);
+               r->lm_pwd_active = true;
+       }
+
+       nt_pass = pdb_get_nt_passwd(smbpass);
+       if (nt_pass != NULL) {
+               memcpy(r->nt_pwd.hash, nt_pass, 16);
+               r->nt_pwd_active = true;
+       }
        r->password_expired = 0; /* FIXME */
 
        TALLOC_FREE(smbpass);


-- 
Samba Shared Repository

Reply via email to