On Sat, Jan 28, 2023 at 5:29 PM Lance Andersen <lance.ander...@oracle.com>
wrote:

> I think it is fine to move the validation immediately following findEND()
> though I am not sure there is a big win overall.
>
> I also would prefer to see the test based off of an actual ZIP(or at least
> have the current/modified version of the test).
>

Hi,

I  updated the PR to "inflate" the CEN such that its size on disk matches
the size stated in the END record. As suggested by Alan, this is done using
sparse files, the actual disk usage is kept low.

While a ZIP with a zero-padded CEN is still not technically valid, the END
record is now at least valid with respect to its offset. This allows us to
test the validation of the various END record validation scenarios
independently and without updating the ZipFile validation order to
facilitate the testing.

There are now three test methods in the test, one for each of the possible
ZipExceptions thrown during END record validation.

Cheers,
Eirik.

Reply via email to