summaryrefslogtreecommitdiff
path: root/source3/passdb
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-12-14 19:12:50 +0100
committerMichael Adam <obnox@samba.org>2010-01-07 11:07:54 +0100
commitec0998ada5eebf5cae63719ef14097639ffef258 (patch)
treed28a636cbda80063c30628b108e74363b6973598 /source3/passdb
parenta3f522202ddc09d444e800ad1da2078975de01c1 (diff)
downloadsamba-ec0998ada5eebf5cae63719ef14097639ffef258.tar.gz
samba-ec0998ada5eebf5cae63719ef14097639ffef258.tar.bz2
samba-ec0998ada5eebf5cae63719ef14097639ffef258.zip
s3: Add a paranoia check to pdb_set_plaintext_passwd()
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/pdb_get_set.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source3/passdb/pdb_get_set.c b/source3/passdb/pdb_get_set.c
index f0c3fb193a..ba19b6bd43 100644
--- a/source3/passdb/pdb_get_set.c
+++ b/source3/passdb/pdb_get_set.c
@@ -1036,6 +1036,11 @@ bool pdb_set_plaintext_passwd(struct samu *sampass, const char *plaintext)
*/
pwhistory = (uchar *)pdb_get_pw_history(sampass, &current_history_len);
+ if ((current_history_len != 0) && (pwhistory == NULL)) {
+ DEBUG(1, ("pdb_set_plaintext_passwd: pwhistory == NULL!\n"));
+ return false;
+ }
+
if (current_history_len < pwHistLen) {
/*
* Ensure we have space for the needed history.