RFR: 8366421: ModifiedUtf.utfLen may overflow for giant string [v5]
Guanqiang Han
ghan at openjdk.org
Sun Sep 21 00:07:55 UTC 2025
> Please review this patch.
>
> **Description:**
>
> Currently, ModifiedUtf.utfLen returns a signed int. For very large strings, this may overflow and produce negative values, leading to incorrect behavior in code that relies on the UTF length. This patch changes the return type to long, which fully resolves the issue and allows safe handling of giant strings.
>
> **Test:**
>
> GHA
Guanqiang Han has updated the pull request incrementally with one additional commit since the last revision:
Update TestUtfLen.java
fix a small error
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/27285/files
- new: https://git.openjdk.org/jdk/pull/27285/files/51d57c60..931507aa
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=27285&range=04
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=27285&range=03-04
Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
Patch: https://git.openjdk.org/jdk/pull/27285.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/27285/head:pull/27285
PR: https://git.openjdk.org/jdk/pull/27285
More information about the core-libs-dev
mailing list