Integrated: 8325002: Exceptions::fthrow needs to ensure it truncates to a valid utf8 string

David Holmes dholmes at openjdk.org
Tue Jul 30 22:38:37 UTC 2024


On Fri, 26 Jul 2024 04:03:10 GMT, David Holmes <dholmes at openjdk.org> wrote:

> Exceptions::fthrow uses a 1024 byte buffer to format the incoming exception message string, but this may not be large enough, leading to truncation. However, we should ensure we truncate to a valid UTF8 sequence.
> 
> The process is explained in the code. Thanks to @RogerRiggs and @djelinski for their suggestions on how to tackle this.
> 
> Testing:
>  - new gtest exercises the truncation code with the different possibilities for bad truncation
>  - tiers 1-3 sanity testing
> 
> Thanks.

This pull request has now been integrated.

Changeset: 5b7bb40d
Author:    David Holmes <dholmes at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/5b7bb40d1f5a8e1261cc252db2a09b5e4f07e5f0
Stats:     194 lines in 4 files changed: 191 ins; 0 del; 3 mod

8325002: Exceptions::fthrow needs to ensure it truncates to a valid utf8 string

Reviewed-by: djelinski, stuefe

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

PR: https://git.openjdk.org/jdk/pull/20345


More information about the hotspot-dev mailing list