On Thu, 18 Apr 2024 12:01:52 GMT, Oliver Kopp <d...@openjdk.org> wrote:

> Fixes https://bugs.openjdk.org/browse/JDK-8330462.
> 
> If the parameter `maxLength` is larger than `Integer.MAX_VALUE - start`, then 
> an addition of `start` to it leads to a negative value. This is "fixed" by 
> using `Math.max` comparing the `maxLength` and `maxLength + start`.

In addition to the comment Andy made about possible other places for the check, 
I'd like to see a test, if possible. Also, this doesn't follow the usual 
pattern of checking for integer overflow, so that could be done in the utility 
method that Andy suggested.

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

PR Comment: https://git.openjdk.org/jfx/pull/1442#issuecomment-2064196119

Reply via email to