RFR: 8280404: Unexpected exception thrown when CEN file entry comment length is not valid
Alan Bateman
alanb at openjdk.java.net
Thu Mar 3 12:07:06 UTC 2022
On Thu, 3 Mar 2022 11:19:12 GMT, Lance Andersen <lancea at openjdk.org> wrote:
> Hi all,
>
> This PR addresses an issue where an unexpected exception is thrown when the CEN file entry comment length is not correct.
>
> Mach5 tiers 1 - 3 run clean with this change.
src/java.base/share/classes/java/util/zip/ZipFile.java line 1214:
> 1212: int elen = CENEXT(cen, pos);
> 1213: int start = entryPos + nlen + elen;
> 1214: zcp.toString(cen, start, clen);
The change look okay but you may want to put another comment on zcp.toString to say that it may throw, otherwise something looking at the code might wonder if it can be removed as the returned String is not used.
-------------
PR: https://git.openjdk.java.net/jdk/pull/7673
More information about the core-libs-dev
mailing list