From: Volker Lendecke Date: Mon, 14 Dec 2009 18:12:50 +0000 (+0100) Subject: s3: Add a paranoia check to pdb_set_plaintext_passwd() X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=58b2f41c14e590724e2cb45f23ff7e75d5d2e7ab;p=samba.git s3: Add a paranoia check to pdb_set_plaintext_passwd() --- diff --git a/source3/passdb/pdb_get_set.c b/source3/passdb/pdb_get_set.c index 87faf2b9ba8..f2e88a17fe8 100644 --- a/source3/passdb/pdb_get_set.c +++ b/source3/passdb/pdb_get_set.c @@ -1035,6 +1035,11 @@ bool pdb_set_plaintext_passwd(struct samu *sampass, const char *plaintext) */ pwhistory = (uchar *)pdb_get_pw_history(sampass, ¤t_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.