[jdk21u-dev] RFR: 8320570: NegativeArraySizeException decoding >1G UTF8 bytes with non-ascii characters

Sonia Zaldana Calles szaldana at openjdk.org
Wed Mar 6 19:36:59 UTC 2024


Hi all, 

This pull request contains a backport of commit [82796bdebbf56b98ec97a6d572ed68c2842f60c6](https://github.com/openjdk/jdk/commit/82796bdebbf56b98ec97a6d572ed68c2842f60c6) from the [openjdk/jdk](https://github.com/openjdk/jdk) repository. 

Note, patch is not clean. 

The only difference between the original commit and this backport is the variable name ```utf16``` [(original commit)](https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/java/lang/String.java#L595) vs ```buf``` [(jdk21u state)](https://github.com/openjdk/jdk21u-dev/blob/master/src/java.base/share/classes/java/lang/String.java#L577). I coalesced those differences by keeping the ```buf``` variable name for jdk21u.



Testing: Was able to verify behaviour with reproducer and added test case passes. 

Thanks!

-------------

Commit messages:
 - Backport 82796bdebbf56b98ec97a6d572ed68c2842f60c6

Changes: https://git.openjdk.org/jdk21u-dev/pull/332/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk21u-dev&pr=332&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8320570
  Stats: 82 lines in 2 files changed: 75 ins; 0 del; 7 mod
  Patch: https://git.openjdk.org/jdk21u-dev/pull/332.diff
  Fetch: git fetch https://git.openjdk.org/jdk21u-dev.git pull/332/head:pull/332

PR: https://git.openjdk.org/jdk21u-dev/pull/332


More information about the jdk-updates-dev mailing list