Integrated: 8297530: java.lang.IllegalArgumentException: Negative length on strings concatenation
Claes Redestad
redestad at openjdk.org
Thu Nov 24 17:44:41 UTC 2022
On Thu, 24 Nov 2022 13:23:13 GMT, Claes Redestad <redestad at openjdk.org> wrote:
> When concatenating Strings, OutOfMemoryError should be thrown on all overflow conditions. This fixes a case that erroneously thro IAE on concatenations of long (`length > Integer.MAX_VALUE/2`) UTF16 strings due failing to check for overflow after shifting index left with the coder.
>
> This was caught by a fuzzer test. Added a sanity test that fails without the patch (loosely derived from ImplicitStringConcatMany.java)
This pull request has now been integrated.
Changeset: 87d1097d
Author: Claes Redestad <redestad at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/87d1097d9be1ef804bfd4640a4254126242b1d8c
Stats: 141 lines in 2 files changed: 139 ins; 0 del; 2 mod
8297530: java.lang.IllegalArgumentException: Negative length on strings concatenation
Reviewed-by: enikitin, alanb
-------------
PR: https://git.openjdk.org/jdk/pull/11354
More information about the core-libs-dev
mailing list