Integrated: 8190753: (zipfs): Accessing a large entry (> 2^31 bytes) leads to a negative initial size for ByteArrayOutputStream
Jaikiran Pai
jpai at openjdk.java.net
Tue Jul 27 02:00:39 UTC 2021
On Mon, 28 Jun 2021 03:41:20 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:
> Can I please get a review for this proposed fix for the issue reported in https://bugs.openjdk.java.net/browse/JDK-8190753?
>
> The commit here checks for the size of the zip entry before trying to create a `ByteArrayOutputStream` for that entry's content. A new jtreg test has been included in this commit to reproduce the issue and verify the fix.
>
> P.S: It's still a bit arguable whether it's a good idea to create the `ByteArrayOutputStream` with an initial size potentially as large as the `MAX_ARRAY_SIZE` or whether it's better to just use some smaller default value. However, I think that can be addressed separately while dealing with https://bugs.openjdk.java.net/browse/JDK-8011146
This pull request has now been integrated.
Changeset: c3d8e922
Author: Jaikiran Pai <jpai at openjdk.org>
URL: https://git.openjdk.java.net/jdk/commit/c3d8e9228d0558a2ce3e093c105c61ea7af2e1d1
Stats: 356 lines in 3 files changed: 350 ins; 0 del; 6 mod
8190753: (zipfs): Accessing a large entry (> 2^31 bytes) leads to a negative initial size for ByteArrayOutputStream
Reviewed-by: lancea
-------------
PR: https://git.openjdk.java.net/jdk/pull/4607
More information about the nio-dev
mailing list