From 6168d95817ebcde746f6cf8fa4da937fff7d80b3 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 17 Dec 2012 17:18:14 +0100 Subject: s3-winbind: Fix null pointer dereference in store_memory_creds(). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Found by Coverity. Signed-off-by: Andreas Schneider Reviewed-by: Günther Deschner --- source3/winbindd/winbindd_cred_cache.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/winbindd/winbindd_cred_cache.c') diff --git a/source3/winbindd/winbindd_cred_cache.c b/source3/winbindd/winbindd_cred_cache.c index e8bbf9c824..01ca3ff1af 100644 --- a/source3/winbindd/winbindd_cred_cache.c +++ b/source3/winbindd/winbindd_cred_cache.c @@ -846,11 +846,11 @@ static NTSTATUS store_memory_creds(struct WINBINDD_MEMORY_CREDS *memcredp, DEBUG(10,("mlocked memory: %p\n", memcredp->nt_hash)); #endif - /* Create and store the password hashes. */ - E_md4hash(pass, memcredp->nt_hash); - E_deshash(pass, memcredp->lm_hash); - if (pass) { + /* Create and store the password hashes. */ + E_md4hash(pass, memcredp->nt_hash); + E_deshash(pass, memcredp->lm_hash); + memcredp->pass = (char *)memcredp->lm_hash + LM_HASH_LEN; memcpy(memcredp->pass, pass, memcredp->len - NT_HASH_LEN - LM_HASH_LEN); -- cgit