RFR: 8366421: ModifiedUtf.utfLen may overflow for giant string

Chen Liang liach at openjdk.org
Thu Sep 18 13:11:30 UTC 2025


On Thu, 18 Sep 2025 12:59:48 GMT, Guanqiang Han <ghan at openjdk.org> wrote:

> This safely simulates a total length exceeding Integer.MAX_VALUE and verifies that the change to long prevents overflow.

Can you try derive a **regression** test that fails on mainline and passes with your fix? You can generate a string with `chunk.repeat(iterations)` and run `ModifiedUtf.utfLen` on it.

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

PR Comment: https://git.openjdk.org/jdk/pull/27285#issuecomment-3307366255


More information about the core-libs-dev mailing list