mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-16 04:39:54 +01:00
Don't erase the original password array, erase the copy.
This commit is contained in:
@@ -74,13 +74,14 @@ class H2Database extends JdbcDatabase {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Connection createConnection() throws SQLException {
|
protected Connection createConnection() throws SQLException {
|
||||||
|
char[] passwordCopy = password.clone();
|
||||||
Properties props = new Properties();
|
Properties props = new Properties();
|
||||||
props.setProperty("user", "user");
|
props.setProperty("user", "user");
|
||||||
props.put("password", password);
|
props.put("password", passwordCopy);
|
||||||
try {
|
try {
|
||||||
return DriverManager.getConnection(url, props);
|
return DriverManager.getConnection(url, props);
|
||||||
} finally {
|
} finally {
|
||||||
Arrays.fill(password, (char) 0);
|
Arrays.fill(passwordCopy, (char) 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user