Guard against null password.

This commit is contained in:
Brian Pellin committed 2011-07-20 00:09:22 -05:00
1 parent a5a9d722a1
commit bf54b00db4
1 file changed
+5 -3
+5 -3
View File
@@ -295,9 +295,11 @@ public class PwEntryV3 extends PwEntry {
public Object clone() {
PwEntryV3 newEntry = (PwEntryV3) super.clone();
int passLen = password.length;
password = new byte[passLen];
System.arraycopy(password, 0, newEntry.password, 0, passLen);
if (password != null) {
int passLen = password.length;
password = new byte[passLen];
System.arraycopy(password, 0, newEntry.password, 0, passLen);
}
newEntry.tCreation = (PwDate) tCreation.clone();
newEntry.tLastMod = (PwDate) tLastMod.clone();