From 2a11f3b3d7b4a009ddfa70511ad2ce3b84aa0539 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 14 Dec 2009 19:16:58 +0100 Subject: s3: Simplify pdb_set_plaintext_passwd: pwHistLen==0 was checked above --- source3/passdb/pdb_get_set.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source3/passdb') diff --git a/source3/passdb/pdb_get_set.c b/source3/passdb/pdb_get_set.c index ba19b6bd43..eed3591fd6 100644 --- a/source3/passdb/pdb_get_set.c +++ b/source3/passdb/pdb_get_set.c @@ -1043,7 +1043,9 @@ bool pdb_set_plaintext_passwd(struct samu *sampass, const char *plaintext) if (current_history_len < pwHistLen) { /* - * Ensure we have space for the needed history. + * Ensure we have space for the needed history. This + * also takes care of an account which did not have + * any history at all so far, i.e. pwhistory==NULL */ uchar *new_history = talloc_zero_array( sampass, uchar, @@ -1059,7 +1061,7 @@ bool pdb_set_plaintext_passwd(struct samu *sampass, const char *plaintext) pwhistory = new_history; } - if (pwhistory && pwHistLen) { + if (pwhistory != NULL) { /* * Make room for the new password in the history list. */ -- cgit