RFR: 8245036: DataInputStream.readFully(byte[], int, int) does not throw expected IndexOutOfBoundsExceptions
Brian Burkhalter
brian.burkhalter at oracle.com
Fri Aug 7 16:39:44 UTC 2020
Hi Raffaello,
> On Aug 7, 2020, at 1:03 AM, Raffaello Giulietti <raffaello.giulietti at gmail.com> wrote:
>
> my previous explanation is (luckily) wrong.
>
> The reason the new tests pass on the old source is because the underlying input stream correctly throws IOOBE which is catched by the tests.
OK.
> There's one corner case that would not pass, however, so I added testNegativeOffsetZeroLength() to exercise that. It passes on the new source but fails on the old.
>
> I also added two additional corner cases for too large combinations of offset and length.
This patch looks good. I am running it through our CI tests but I don’t expect to see any problems. If the test run succeeds aside from any failures unrelated to this code then I can push this.
Thanks,
Brian
More information about the core-libs-dev
mailing list