From 7633837026d56ee723ffb603c9bd884ff6c69ef3 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 14 Dec 2009 18:44:38 +0100 Subject: s3: Simplify pdb_set_plaintext_passwd: memcpy deals fine with 0 bytes --- source3/passdb/pdb_get_set.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'source3/passdb') diff --git a/source3/passdb/pdb_get_set.c b/source3/passdb/pdb_get_set.c index 149dde0802..968da9d8d1 100644 --- a/source3/passdb/pdb_get_set.c +++ b/source3/passdb/pdb_get_set.c @@ -1058,11 +1058,8 @@ bool pdb_set_plaintext_passwd(struct samu *sampass, const char *plaintext) return False; } - /* And copy it into the new buffer. */ - if (current_history_len) { - memcpy(new_history, pwhistory, - current_history_len*PW_HISTORY_ENTRY_LEN); - } + memcpy(new_history, pwhistory, + current_history_len*PW_HISTORY_ENTRY_LEN); pwhistory = new_history; } -- cgit