Skip to content

Commit

Permalink
zip: Re-add zip64 fix (#624)
Browse files Browse the repository at this point in the history
Accidentally reverted #313 in #432

Fixes #623
  • Loading branch information
klauspost committed Jun 9, 2022
1 parent 3221590 commit 999ca10
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion zip/writer.go
Expand Up @@ -125,7 +125,7 @@ func (w *Writer) Close() error {
b.uint16(uint16(len(h.Comment)))
b = b[4:] // skip disk number start and internal file attr (2x uint16)
b.uint32(h.ExternalAttrs)
if h.offset > uint32max {
if h.isZip64() || h.offset > uint32max {
b.uint32(uint32max)
} else {
b.uint32(uint32(h.offset))
Expand Down

0 comments on commit 999ca10

Please sign in to comment.