diff options
author | Volker Lendecke <vl@samba.org> | 2009-12-14 18:43:03 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2010-01-07 11:07:53 +0100 |
commit | 864ed92954315600ddcef69b21face95c06224a4 (patch) | |
tree | 3948b089f32fc3a925476215b42bcec3ed964bb1 /source3/passdb | |
parent | e7290255f5ba1dd913bb3d40e71654cff1cfe4cf (diff) | |
download | samba-864ed92954315600ddcef69b21face95c06224a4.tar.gz samba-864ed92954315600ddcef69b21face95c06224a4.tar.bz2 samba-864ed92954315600ddcef69b21face95c06224a4.zip |
s3: Simplify pdb_set_plaintext_passwd by using talloc_zero_array
Diffstat (limited to 'source3/passdb')
-rw-r--r-- | source3/passdb/pdb_get_set.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/source3/passdb/pdb_get_set.c b/source3/passdb/pdb_get_set.c index bea4c3278e..149dde0802 100644 --- a/source3/passdb/pdb_get_set.c +++ b/source3/passdb/pdb_get_set.c @@ -1051,7 +1051,7 @@ bool pdb_set_plaintext_passwd(struct samu *sampass, const char *plaintext) /* * Ensure we have space for the needed history. */ - uchar *new_history = talloc_array( + uchar *new_history = talloc_zero_array( sampass, uchar, pwHistLen*PW_HISTORY_ENTRY_LEN); if (!new_history) { @@ -1063,10 +1063,7 @@ bool pdb_set_plaintext_passwd(struct samu *sampass, const char *plaintext) memcpy(new_history, pwhistory, current_history_len*PW_HISTORY_ENTRY_LEN); } - /* Clearing out any extra space. */ - memset(&new_history[current_history_len*PW_HISTORY_ENTRY_LEN], - '\0', (pwHistLen-current_history_len)*PW_HISTORY_ENTRY_LEN); - /* Finally replace it. */ + pwhistory = new_history; } } |