summaryrefslogtreecommitdiff
path: root/source3/winbindd/winbindd_cred_cache.c
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2012-12-17 17:18:14 +0100
committerGünther Deschner <gd@samba.org>2012-12-21 13:56:01 +0100
commit6168d95817ebcde746f6cf8fa4da937fff7d80b3 (patch)
tree68c53d083be06f0e5c508c230dad908404406dd1 /source3/winbindd/winbindd_cred_cache.c
parent9631e5b1e490349dd59f0772ecba11be9f2ba963 (diff)
downloadsamba-6168d95817ebcde746f6cf8fa4da937fff7d80b3.tar.gz
samba-6168d95817ebcde746f6cf8fa4da937fff7d80b3.tar.bz2
samba-6168d95817ebcde746f6cf8fa4da937fff7d80b3.zip
s3-winbind: Fix null pointer dereference in store_memory_creds().
Found by Coverity. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
Diffstat (limited to 'source3/winbindd/winbindd_cred_cache.c')
-rw-r--r--source3/winbindd/winbindd_cred_cache.c8
1 files changed, 4 insertions, 4 deletions
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);