RFR: 8190753: (zipfs): Accessing a large entry (> 2^31 bytes) leads to a negative initial size for ByteArrayOutputStream
Lance Andersen
lance.andersen at oracle.com
Mon Jun 28 22:47:29 UTC 2021
Hi Jaikiran,
This is on my list to look at but did not get to today.
Best
Lance
On Jun 27, 2021, at 11:52 PM, Jaikiran Pai <jpai at openjdk.java.net<mailto:jpai at openjdk.java.net>> 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
-------------
Commit messages:
- 8190753: (zipfs): Accessing a large entry (> 2^31 bytes) leads to a negative initial size for ByteArrayOutputStream
Changes: https://git.openjdk.java.net/jdk/pull/4607/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=4607&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8190753
Stats: 139 lines in 2 files changed: 138 ins; 0 del; 1 mod
Patch: https://git.openjdk.java.net/jdk/pull/4607.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/4607/head:pull/4607
PR: https://git.openjdk.java.net/jdk/pull/4607
[cid:E1C4E2F0-ECD0-4C9D-ADB4-B16CA7BCB7FC at home]
Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
Oracle Java Engineering
1 Network Drive
Burlington, MA 01803
Lance.Andersen at oracle.com<mailto:Lance.Andersen at oracle.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20210628/cbd82b52/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: oracle_sig_logo.gif
Type: image/gif
Size: 658 bytes
Desc: oracle_sig_logo.gif
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20210628/cbd82b52/oracle_sig_logo.gif>
More information about the nio-dev
mailing list