Skip to content

Commit

Permalink
Add warning for a zip file entry 4 GiB or larger.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
madler committed Oct 2, 2016
1 parent 06b5347 commit 04c6ab1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pigz.c
Expand Up @@ -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 */
Expand Down

0 comments on commit 04c6ab1

Please sign in to comment.