Skip to content

8306623: (bf) CharBuffer::allocate throws unexpected exception type with some CharSequences#13632

Closed
bplb wants to merge 3 commits intoopenjdk:masterfrom
bplb:CharBuffer-allocate-IOOBE-8306623
Closed

8306623: (bf) CharBuffer::allocate throws unexpected exception type with some CharSequences#13632
bplb wants to merge 3 commits intoopenjdk:masterfrom
bplb:CharBuffer-allocate-IOOBE-8306623

Conversation

@bplb
Copy link
Member

@bplb bplb commented Apr 25, 2023

When appending a CharBuffer, perform a specific check for buffer overflow before invoking put().


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8306623: (bf) CharBuffer::allocate throws unexpected exception type with some CharSequences

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/13632/head:pull/13632
$ git checkout pull/13632

Update a local copy of the PR:
$ git checkout pull/13632
$ git pull https://git.openjdk.org/jdk.git pull/13632/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 13632

View PR using the GUI difftool:
$ git pr show -t 13632

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/13632.diff

Webrev

Link to Webrev Comment

@bplb
Copy link
Member Author

bplb commented Apr 25, 2023

I'm not entirely comfortable with where I've put the test in this patch.

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 25, 2023

👋 Welcome back bpb! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Pull request is ready for review label Apr 25, 2023
@openjdk
Copy link

openjdk bot commented Apr 25, 2023

@bplb The following labels will be automatically applied to this pull request:

  • core-libs
  • nio

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added nio nio-dev@openjdk.org core-libs core-libs-dev@openjdk.org labels Apr 25, 2023
@mlbridge
Copy link

mlbridge bot commented Apr 25, 2023

Webrevs

@AlanBateman
Copy link
Contributor

Can you add a test to test/jdk/java/nio/Buffer/Basic-X.java.template, I think this regression was missed because this tests didn't check this case.

@bplb
Copy link
Member Author

bplb commented Apr 25, 2023

[...] I think this regression was missed because this tests didn't check this case.

It definitely was.

@openjdk
Copy link

openjdk bot commented Apr 25, 2023

@bplb This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8306623: (bf) CharBuffer::allocate throws unexpected exception type with some CharSequences

Reviewed-by: alanb, lancea

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 28 new commits pushed to the master branch:

  • 28829f3: 8306734: Shenandoah: Missing barriers on deoptimization path
  • 9beae21: 8306718: Optimize and opensource some old AWT tests
  • 36d61c3: 8306765: Some client related jtreg problem list entries are malformed
  • 5f4965d: 8306687: Relax memory ordering constraints on metaspace atomic counters
  • 33d6614: 8304845: Update PCSC-Lite for Suse Linux to 1.9.9 and fix incomplete license wording
  • c92883a: 8306772: Remove sun.security.x509.CertException, sun.security.x509.CertParseError
  • 0ff3a27: 8306008: Several Vector API tests fail for client VM after JDK-8304450
  • e8f62de: 8304676: [vectorapi] x86_32: Crash in Assembler::kmovql(Address, KRegister)
  • 98e8616: 8301169: java/net/httpclient/ThrowingSubscribersAsInputStream.java,ThrowingSubscribersAsInputStreamAsync.java, and other httpclient tests failing on windows: Unable to establish loopback connection
  • 07ea445: 8306838: GetGraphicsTest needs to be headful
  • ... and 18 more: https://git.openjdk.org/jdk/compare/314db55f6dde033f62481b62f10dd11030473569...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Apr 25, 2023
@bplb
Copy link
Member Author

bplb commented Apr 25, 2023

/integrate

@openjdk
Copy link

openjdk bot commented Apr 25, 2023

Going to push as commit e3ccaa6.
Since your change was applied there have been 29 commits pushed to the master branch:

  • d819deb: 8304423: Refactor FdLibm.java
  • 28829f3: 8306734: Shenandoah: Missing barriers on deoptimization path
  • 9beae21: 8306718: Optimize and opensource some old AWT tests
  • 36d61c3: 8306765: Some client related jtreg problem list entries are malformed
  • 5f4965d: 8306687: Relax memory ordering constraints on metaspace atomic counters
  • 33d6614: 8304845: Update PCSC-Lite for Suse Linux to 1.9.9 and fix incomplete license wording
  • c92883a: 8306772: Remove sun.security.x509.CertException, sun.security.x509.CertParseError
  • 0ff3a27: 8306008: Several Vector API tests fail for client VM after JDK-8304450
  • e8f62de: 8304676: [vectorapi] x86_32: Crash in Assembler::kmovql(Address, KRegister)
  • 98e8616: 8301169: java/net/httpclient/ThrowingSubscribersAsInputStream.java,ThrowingSubscribersAsInputStreamAsync.java, and other httpclient tests failing on windows: Unable to establish loopback connection
  • ... and 19 more: https://git.openjdk.org/jdk/compare/314db55f6dde033f62481b62f10dd11030473569...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Apr 25, 2023
@openjdk openjdk bot closed this Apr 25, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Apr 25, 2023
@openjdk
Copy link

openjdk bot commented Apr 25, 2023

@bplb Pushed as commit e3ccaa6.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@bplb bplb deleted the CharBuffer-allocate-IOOBE-8306623 branch April 25, 2023 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core-libs core-libs-dev@openjdk.org integrated Pull request has been integrated nio nio-dev@openjdk.org

Development

Successfully merging this pull request may close these issues.

3 participants