Skip to content

Commit

Permalink
Check LH offset when writing LH. Fix dotnet#94899
Browse files Browse the repository at this point in the history
ZipArchiveEntry didn't set ZIP64 in local
headers for small files if their offset are
>4GB.
  • Loading branch information
karakasa authored and carlossanlop committed May 9, 2024
1 parent 7037516 commit dc589e5
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,7 @@ private void WriteCrcAndSizesInLocalHeader(bool zip64HeaderUsed)
long finalPosition = _archive.ArchiveStream.Position;
BinaryWriter writer = new BinaryWriter(_archive.ArchiveStream);

bool zip64Needed = SizesTooLarge()
bool zip64Needed = SizesTooLarge() || (_offsetOfLocalHeader > uint.MaxValue)
#if DEBUG_FORCE_ZIP64
|| _archive._forceZip64
#endif
Expand Down

0 comments on commit dc589e5

Please sign in to comment.