List Archive


Thread Index


From: Thomas Klausner <>
To: Martin Buchholz <>
Subject: Re: [PATCH 0/3] libzip does not use EOCD nentry field in PK-WARE compatible way
Date: Thu, 25 Aug 2016 14:09:55 +0200

On Tue, Aug 16, 2016 at 08:46:04AM -0700, Martin Buchholz wrote:
> I worked on the JDK's zip implementation - here's a comment I wrote many
> years ago:
>     /* Initialize zip file data structures based on the total number
>      * of central directory entries as stored in ENDTOT.  Since this
>      * is a 2-byte field, but we (and other zip implementations)
>      * support approx. 2**31 entries, we do not trust ENDTOT, but
>      * treat it only as a strong hint.

libzip treats it as an error if the count is off (modulo 0x10000 now
in case of plain zip).

> There's also the other common bug of seeing that ENDTOT is 0xFFFF and
> assuming that means ZIP64 is surely being used.

libzip does not assume that.


Made by MHonArc.