On Thu, 16 Feb 2023 14:42:52 GMT, Jaikiran Pai <j...@openjdk.org> wrote:
> Can I please get a review of this change which fixes the usage of > `Preconditions.checkFromIndexSize`? This addresses > https://bugs.openjdk.org/browse/JDK-8302664. > > There was an oversight when these changes were introduced in > https://github.com/openjdk/jdk/pull/4507. I have now gone through that patch > again to make sure the relevant places where this fix is needed has been > addressed in this current PR. > > I have also looked into other changes in that PR, just to be sure that there > aren't any similar fixes needed for other method calls that were introduced > in it - they all look fine. > > tier1,tier2 and tier3 testing with this change passed successfully. I thought > (and experimented a bit) to add new tests for Deflater/Inflater to catch > these byte array indexing issues, but it wasn't straight forward and I would > have to write the entire inflate/deflate test just to verify this issue. So I > decided to leave out new tests for now in this PR. As far as I could tell, this only changes the generated exception message. The condition is (off+len<=size), so the exception will be thrown on the same input as before. LGTM. ------------- Marked as reviewed by djelinski (Committer). PR: https://git.openjdk.org/jdk/pull/12595