Skip to content

Commit

Permalink
8321409: Console read line with zero out should zero out underlying b…
Browse files Browse the repository at this point in the history
…uffer in JLine (redux)

Backport-of: 4ed38f5ad5f822ab948257ed39717ea919fd32ed
  • Loading branch information
GoeLin committed Dec 21, 2023
1 parent 12915c3 commit e4056b9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
Expand Up @@ -112,7 +112,7 @@ public char[] readPassword(String fmt, Object ... args) {
} catch (EndOfFileException eofe) {
return null;
} finally {
jline.getBuffer().zeroOut();
jline.zeroOut();
}
}

Expand Down
Expand Up @@ -750,4 +750,9 @@ enum SuggestionType {
void setAutosuggestion(SuggestionType type);

SuggestionType getAutosuggestion();

// JDK specific modification
default void zeroOut() {
throw new UnsupportedOperationException();
}
}
Expand Up @@ -6250,4 +6250,10 @@ private void rebind(KeyMap<Binding> keyMap, String operation, String prevBinding
}
}

// JDK specific modification
@Override
public void zeroOut() {
buf.zeroOut();
parsedLine = null;
}
}

1 comment on commit e4056b9

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.