RFR: 8190753: (zipfs): Accessing a large entry (> 2^31 bytes) leads to a negative initial size for ByteArrayOutputStream [v10]
Jaikiran Pai
jpai at openjdk.java.net
Fri Jul 23 11:52:47 UTC 2021
> 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
Jaikiran Pai has updated the pull request incrementally with one additional commit since the last revision:
Implement review suggestions:
- remove unnecessary "synchronized"
- no need to open the temp file twice
-------------
Changes:
- all: https://git.openjdk.java.net/jdk/pull/4607/files
- new: https://git.openjdk.java.net/jdk/pull/4607/files/90101d45..9e78ba06
Webrevs:
- full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4607&range=09
- incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4607&range=08-09
Stats: 12 lines in 1 file changed: 5 ins; 4 del; 3 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
More information about the nio-dev
mailing list