On Tue, 18 Jul 2023 01:52:35 GMT, 温绍锦 <d...@openjdk.org> wrote:

>> I think he means to check the `charPos` to ensure it is not out of bounds.
>
> Oh, I see, charPos needs to do bound checks,  I added assert with reference 
> to the implementation of StringUTF16#putChar, is this safe enough?

I think we might need to look into the code around to ensure user input cannot 
cause charPos to go out of bounds. If charPos is not touched by user code at 
all, I think assert suffices (which are enabled via -esa and is thus enabled in 
the jtreg test suite)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14699#discussion_r1266092100

Reply via email to