8322417: Console read line with zero out should zero out when throwing exception
Reviewed-by: mbaesken, stuefe, naoto
This commit is contained in:
parent
7db69e6a12
commit
2f917bff5c
@ -119,8 +119,17 @@ public final class JdkConsoleImpl implements JdkConsole {
|
||||
else
|
||||
ioe.addSuppressed(x);
|
||||
}
|
||||
if (ioe != null)
|
||||
if (ioe != null) {
|
||||
java.util.Arrays.fill(passwd, ' ');
|
||||
try {
|
||||
if (reader instanceof LineReader lr) {
|
||||
lr.zeroOut();
|
||||
}
|
||||
} catch (IOException x) {
|
||||
// ignore
|
||||
}
|
||||
throw ioe;
|
||||
}
|
||||
}
|
||||
pw.println();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user