On Thu, 3 Mar 2022 11:19:12 GMT, Lance Andersen <[email protected]> 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

Reply via email to