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)

Reviewed-by: alanb
  • Loading branch information
naotoj committed Dec 7, 2023
1 parent fe4c0a2 commit 4ed38f5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
Expand Up @@ -114,7 +114,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;
}
}

5 comments on commit 4ed38f5

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

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

@naotoj
Copy link
Member Author

@naotoj naotoj commented on 4ed38f5 Dec 8, 2023

Choose a reason for hiding this comment

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

/backport jdk22

@openjdk
Copy link

@openjdk openjdk bot commented on 4ed38f5 Dec 8, 2023

Choose a reason for hiding this comment

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

@naotoj the backport was successfully created on the branch backport-naotoj-4ed38f5a in my personal fork of openjdk/jdk22. To create a pull request with this backport targeting openjdk/jdk22:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 4ed38f5a from the openjdk/jdk repository.

The commit being backported was authored by Naoto Sato on 7 Dec 2023 and was reviewed by Alan Bateman.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk22:

$ git fetch https://github.com/openjdk-bots/jdk22.git backport-naotoj-4ed38f5a:backport-naotoj-4ed38f5a
$ git checkout backport-naotoj-4ed38f5a
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk22.git backport-naotoj-4ed38f5a

@GoeLin
Copy link
Member

@GoeLin GoeLin commented on 4ed38f5 Dec 19, 2023

Choose a reason for hiding this comment

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

/backport jdk21u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 4ed38f5 Dec 19, 2023

Choose a reason for hiding this comment

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

@GoeLin the backport was successfully created on the branch backport-GoeLin-4ed38f5a in my personal fork of openjdk/jdk21u-dev. To create a pull request with this backport targeting openjdk/jdk21u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 4ed38f5a from the openjdk/jdk repository.

The commit being backported was authored by Naoto Sato on 7 Dec 2023 and was reviewed by Alan Bateman.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk21u-dev:

$ git fetch https://github.com/openjdk-bots/jdk21u-dev.git backport-GoeLin-4ed38f5a:backport-GoeLin-4ed38f5a
$ git checkout backport-GoeLin-4ed38f5a
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk21u-dev.git backport-GoeLin-4ed38f5a

Please sign in to comment.