s3: Simplify pdb_set_plaintext_passwd: memcpy deals fine with 0 bytes
authorVolker Lendecke <vl@samba.org>
Mon, 14 Dec 2009 17:44:38 +0000 (18:44 +0100)
committerMichael Adam <obnox@samba.org>
Thu, 7 Jan 2010 10:07:53 +0000 (11:07 +0100)
source3/passdb/pdb_get_set.c

index 149dde080206fc2f421efd480a8d7a83f8a55601..968da9d8d149ade5692dd21a9341e358dd4913a6 100644 (file)
@@ -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;
                }