Commit 04c6ab17 authored by Mark Adler's avatar Mark Adler

Add warning for a zip file entry 4 GiB or larger.

pigz currently will not generate a ZIP64 format .zip file if the
input uncompressed or compressed lengths are greater than or equal
to 4 GiB. This commit issues a warning in that instance that the
resulting .zip file will be unusable.
parent 06b53479
......@@ -1048,6 +1048,8 @@ local void put_trailer(unsigned long ulen, unsigned long clen,
PUT4L(tail + 8, clen);
PUT4L(tail + 12, ulen);
writen(g.outd, tail, 16);
if (clen > UINT32_MAX || ulen > UINT32_MAX)
complain("4 GiB or greater length: %s will be unusable", g.outf);
/* write central file header */
PUT4L(tail, 0x02014b50UL); /* central header signature */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment