On Thu, 18 Apr 2024 21:27:12 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`. > > Oliver Kopp has updated the pull request incrementally with one additional > commit since the last revision: > > start should be at most maxEnd I left one inline comment. I'd like @arapte to review this, since he is familiar with this code, having fixed other IOOBE bugs in it. Reviewers: @arapte @andy-goryachev-oracle modules/javafx.graphics/src/main/java/com/sun/glass/ui/win/WinTextRangeProvider.java line 101: > 99: > 100: int length = text.length(); > 101: start = getValidStringIndex(start, 0, length); This change doesn't seem necessary. There is no possibility of integer overflow here. ------------- PR Review: https://git.openjdk.org/jfx/pull/1442#pullrequestreview-2009986037 PR Comment: https://git.openjdk.org/jfx/pull/1442#issuecomment-2065411004 PR Review Comment: https://git.openjdk.org/jfx/pull/1442#discussion_r1571433383