From ec0998ada5eebf5cae63719ef14097639ffef258 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 14 Dec 2009 19:12:50 +0100 Subject: [PATCH] s3: Add a paranoia check to pdb_set_plaintext_passwd() --- source3/passdb/pdb_get_set.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source3/passdb/pdb_get_set.c b/source3/passdb/pdb_get_set.c index f0c3fb193af..ba19b6bd438 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, ¤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. -- 2.11.4.GIT